Module cosmic::iced::widget::text_editor
source · Expand description
Text editors display a multi-line text input for text editing.
§Example
use iced::widget::text_editor;
struct State {
content: text_editor::Content,
}
#[derive(Debug, Clone)]
enum Message {
Edit(text_editor::Action)
}
fn view(state: &State) -> Element<'_, Message> {
text_editor(&state.content)
.placeholder("Type something here...")
.on_action(Message::Edit)
.into()
}
fn update(state: &mut State, message: Message) {
match message {
Message::Edit(action) => {
state.content.perform(action);
}
}
}
Structs§
- The content of a
TextEditor
. - A key press.
- The state of a
TextEditor
. - The appearance of a text input.
- A multi-line text input.
Enums§
- An interaction with an
Editor
. - A binding to an action in the
TextEditor
. - An action that edits text.
- A cursor movement.
- The possible status of a
TextEditor
.
Traits§
- The theme catalog of a
TextEditor
.
Functions§
- The default style of a
TextEditor
.
Type Aliases§
- A styling function for a
TextEditor
.