Raxol.UI.Components.Input.TextField (Raxol v0.5.0)
View SourceA text field component for single-line text input.
It supports validation, placeholders, masks, and styling.
Summary
Functions
Handles events for the TextField component, such as keypresses, focus, and blur.
Initializes the TextField component state from the given props.
Mounts the TextField component. Performs any setup needed after initialization.
Renders the TextField component using the current state and context.
Unmounts the TextField component, performing any necessary cleanup.
Updates the TextField component state in response to messages or prop changes.
Types
@type t() :: %Raxol.UI.Components.Input.TextField{ cursor_pos: non_neg_integer(), disabled: boolean(), focused: boolean(), id: any(), placeholder: String.t(), scroll_offset: non_neg_integer(), secret: boolean(), style: map(), theme: map(), value: String.t(), width: non_neg_integer() }
State for the TextField component.
- :id - unique identifier
- :value - current text value
- :placeholder - placeholder text
- :style - style map
- :theme - theme map
- :disabled - whether the field is disabled
- :secret - whether to mask input (e.g., password)
- :focused - whether the field is focused
- :cursor_pos - cursor position
- :scroll_offset - horizontal scroll offset
- :width - visible width of the field (not in defstruct, but added in init)
Functions
Handles events for the TextField component, such as keypresses, focus, and blur.
Initializes the TextField component state from the given props.
Mounts the TextField component. Performs any setup needed after initialization.
Renders the TextField component using the current state and context.
Unmounts the TextField component, performing any necessary cleanup.
Updates the TextField component state in response to messages or prop changes.