A label, the control it names, and under it a hint (a rule, an example) or, when error is not empty, the error in the colour of a danger. The hint and the error are one line of text that is kept: it changes, it is never removed.
Signature
pub fn form_field<'a, M: Clone + 'a, V: View<M> + 'a>( label: &'a str, control: V, hint: &'a str, error: &'a str, ) -> impl View<M> + 'aExample
use fusuma::{form_field, text_field};
let email = "ada@";
let error = if email.contains('.') { "" } else { "Not an email address" };
let view = form_field("Email", text_field(email).on_input(|_| ()), "We never share it", error);
let built = fusuma::doc::built::<(), _>(&view);
assert!(built.texts().contains(&"Email"));