Raxol.UI.Components.Input.SingleLineInput (Raxol v2.0.1)
View SourceA simple single-line text input component.
Summary
Functions
Handles events for the SingleLineInput component, such as keypresses and mouse clicks.
Initializes the SingleLineInput component state from the given props.
Mount hook - called when component is mounted. No special setup needed for SingleLineInput.
Renders the SingleLineInput component using the current state and props.
Unmount hook - called when component is unmounted. No cleanup needed for SingleLineInput.
Updates the SingleLineInput component state in response to messages or prop changes.
Types
@type t() :: %Raxol.UI.Components.Input.SingleLineInput{ cursor_pos: non_neg_integer(), focused: boolean(), id: any(), on_change: (String.t() -> any()) | nil, on_submit: (-> any()) | nil, placeholder: String.t(), style: map(), value: String.t() }
State for the SingleLineInput component.
- :id - unique identifier
- :value - current text value
- :placeholder - placeholder text
- :style - style map
- :focused - whether the field is focused
- :cursor_pos - cursor position
- :on_change - callback for value change
- :on_submit - callback for submit action
Functions
Handles events for the SingleLineInput component, such as keypresses and mouse clicks.
Initializes the SingleLineInput component state from the given props.
Mount hook - called when component is mounted. No special setup needed for SingleLineInput.
Renders the SingleLineInput component using the current state and props.
Unmount hook - called when component is unmounted. No cleanup needed for SingleLineInput.
Updates the SingleLineInput component state in response to messages or prop changes.