Function TextField

Source
pub fn TextField(_: TextFieldProps) -> Element
Expand description

Text field component.

Text fields let users enter text into a UI.

material.io

§Panics

This component requires access to a Theme.

§Examples

use dioxus::prelude::*;
use dioxus_material::{TextField, Theme};

fn app() -> Element {
    let mut value = use_signal(|| String::from("Filled"));
    rsx!(
        Theme {
            TextField {
                label: "Text field",
                value: "{value}",
                onchange: move |event: FormEvent| value.set(event.value())
            }
        }
    )
}

§Props

For details, see the props struct definition.