Raxol.UI.Components.Input.SingleLineInput (Raxol v0.4.0)
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.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the SingleLineInput component using the current state and props.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
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.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the SingleLineInput component using the current state and props.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Updates the SingleLineInput component state in response to messages or prop changes.