Components / FormLayout

FormLayout

Groups of fields in columns, tabs and a list of errors.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn form_layout() -> impl View {
    let (name, city, notes) =
        (State::new(String::new()), State::new(String::new()), State::new(String::new()));
    FormLayout::new().columns(2).group(
        FormGroup::titled("Contact")
            .field(FormField::new("Name", TextField::new(name.binding())).required())
            .field(FormField::new("City", TextField::new(city.binding())))
            .wide(FormField::new("Notes", TextArea::new(notes.binding()).rows(2))),
    )
}

Open in the playground, with every example →

Full API of FormLayout →