Skip to main content

euv_ui/component/textarea/view/
struct.rs

1use super::*;
2
3/// Props for the `euv_textarea` component.
4///
5/// A textarea is the multi-line sibling of the single-line input: the
6/// value lives in a caller-owned signal so the surrounding form can read
7/// the whole field state back.
8#[derive(Clone, CustomDebug, Data, Default)]
9pub struct EuvTextareaProps {
10    /// The unique identifier of the textarea element.
11    #[get(type(copy))]
12    pub id: &'static str,
13    /// The HTML name attribute for the textarea element.
14    #[get(type(copy))]
15    pub name: &'static str,
16    /// The placeholder text shown when the field is empty.
17    #[get(type(copy))]
18    pub placeholder: &'static str,
19    /// The current text (reactive signal).
20    pub value: Signal<String>,
21    /// The visible height of the field in rows. Zero means the default.
22    #[get(type(copy))]
23    pub rows: i32,
24    /// Whether the field is disabled.
25    #[get(type(copy))]
26    pub disabled: Signal<bool>,
27    /// Optional input event handler.
28    #[debug(skip)]
29    pub oninput: Option<Rc<dyn Fn(Event)>>,
30    /// The accessible name when no visible label is present.
31    pub aria_label: &'static str,
32    /// Optional keyboard handler for editor shortcuts.
33    #[debug(skip)]
34    pub onkeydown: Option<Rc<dyn Fn(Event)>>,
35    /// An optional application class composed with the design-system textarea class.
36    pub class: Css,
37}