Skip to main content

Module form

Module form 

Source
Expand description

Form โ€” vertical labeled-field layout.

Render fields inside the show closure; each gets a label (with an optional required marker) above the input, plus an optional description line below.

โ“˜
sc::Form::new().show(ui, |form| {
    form.field("Email", |ui| { ui.add(sc::Input::new(&mut email)); });
    form.field_with_hint("Password", "At least 8 characters", |ui| {
        ui.add(sc::Input::new(&mut pw).password(true));
    });
    form.required("Full name", |ui| { ui.add(sc::Input::new(&mut name)); });
});

Structsยง

Form
FormUi
Builder handed to the Form::show closure.