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. - Id
 - The identifier of a 
TextInput. - 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 
Paddingof aTextInput. 
Traits§
Functions§
- default
 - The default style of a 
TextInput. - focus
 - Produces a 
Taskthat focuses theTextInputwith the givenId. - move_
cursor_ to  - Produces a 
Taskthat moves the cursor of theTextInputwith the givenIdto the provided position. - move_
cursor_ to_ end  - Produces a 
Taskthat moves the cursor of theTextInputwith the givenIdto the end. - move_
cursor_ to_ front  - Produces a 
Taskthat moves the cursor of theTextInputwith the givenIdto the front. - select_
all  - Produces a 
Taskthat selects all the content of theTextInputwith the givenId.