euv_ui/component/input/view/struct.rs
1use super::*;
2
3/// Props for the `euv_input` component.
4///
5/// Defines the strongly-typed interface for the labeled input field.
6#[derive(Clone, CustomDebug, Default)]
7pub struct EuvInputProps {
8 /// The unique identifier for the input element.
9 pub id: &'static str,
10 /// The HTML name attribute for the input element.
11 pub name: &'static str,
12 /// The label text displayed above the input. Empty string means no label.
13 pub label: &'static str,
14 /// The HTML input type (e.g. "text", "email", "password", "number").
15 pub input_type: &'static str,
16 /// The placeholder text shown when the input is empty.
17 pub placeholder: &'static str,
18 /// The current input value (reactive Signal).
19 pub value: Signal<String>,
20 /// The autocomplete hint for the browser.
21 pub autocomplete: &'static str,
22 /// Optional input event handler. Defaults to `on_input_value(value)` if None.
23 #[debug(skip)]
24 pub oninput: Option<Rc<dyn Fn(Event)>>,
25 /// Optional custom CSS class. Defaults to `c_euv_input()` if empty.
26 pub class: Css,
27 /// The accessible name when the visible label is omitted.
28 pub aria_label: &'static str,
29 /// Whether the value may be edited.
30 pub readonly: bool,
31 /// Whether the control is disabled.
32 pub disabled: Signal<bool>,
33 /// Optional class applied to the input wrapper.
34 pub wrapper_class: Css,
35 /// Whether the control is required.
36 pub required: bool,
37 /// Maximum number of characters accepted; zero leaves it unspecified.
38 pub max_length: usize,
39 /// The browser step for numeric/date controls; empty leaves the default.
40 pub step: &'static str,
41 /// An IDREF naming the field's hint or description.
42 pub aria_describedby: &'static str,
43}