Available on crate feature
textarea only.Expand description
Multi-line text editing.
A tap places the caret and a vertical drag scrolls the text, as with the mouse, so a textarea works on a touch screen.
Undo, redo, word deletion and Escape follow the same Shortcuts as
inputs. Undo sends ordinary Actions, so an app that applies each
action to its Content needs no changes. Switch some or all of them
off by passing a Shortcuts set to Textarea::shortcuts.
The app owns the Content and applies each Action in update:
use iced::widget::text_editor::{Action, Content};
use iced_cube::textarea;
#[derive(Debug, Clone)]
enum Message { Edit(Action) }
let content = Content::new();
let view: iced::Element<'_, Message> = textarea(&content)
.placeholder("Write a note")
.on_action(Message::Edit)
.into();Re-exports§
Structs§
- Content
- The content of a
TextEditor. - Textarea
- A textarea builder. Convert it into an
Elementto render.
Enums§
Constants§
- MIN_
HEIGHT - Minimum height while the height is
Length::Shrink, roughly three lines.