Function freya::prelude::Input

source ·
pub fn Input<'a>(cx: &'a Scoped<'a, InputProps<'a>>) -> Option<VNode<'a>>
Expand description

Input component.

Props

See InputProps.

Styling

Inherits the ButtonTheme theme.

Example

fn app(cx: Scope) -> Element {
    use_init_focus(cx);
    let value = use_state(cx, String::new);

    render!(
        label {
            "Value: {value}"
        }
        Input {
            value: value.get().clone(),
            onchange: |e| {
                 value.set(e)
            }
        }
    )
}