Expand description
Text inputs display fields that can be filled with text.
§Example
use iced::widget::text_input;
struct State {
content: String,
}
#[derive(Debug, Clone)]
enum Message {
ContentChanged(String)
}
fn view(state: &State) -> Element<'_, Message> {
text_input("Type something here...", &state.content)
.on_input(Message::ContentChanged)
.into()
}
fn update(state: &mut State, message: Message) {
match message {
Message::ContentChanged(content) => {
state.content = content;
}
}
}
Modules§
- cursor
- Track the cursor of a text input.
Structs§
- Cursor
- The cursor of a text input.
- Icon
- The content of the
Icon
. - State
- The state of a
TextInput
. - Style
- The appearance of a text input.
- Text
Input - A field that can be filled with text.
- Value
- The value of a
TextInput
.
Enums§
Constants§
- DEFAULT_
PADDING - The default
Padding
of aTextInput
.