Module cosmic::iced_widget::text_input
source · 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§
- Track the cursor of a text input.
Structs§
- The cursor of a text input.
- The content of the
Icon
. - The identifier of a
TextInput
. - The state of a
TextInput
. - The appearance of a text input.
- A field that can be filled with text.
- The value of a
TextInput
.
Enums§
Constants§
Traits§
- The theme catalog of a
TextInput
.
Functions§
- The default style of a
TextInput
.
Type Aliases§
- A styling function for a
TextInput
.