OptionalinputOptional HTML input type attribute value.
When set, this overrides the type input on UIInput so the
adapter can request the semantically correct native input type
(e.g. "email", "tel", "url").
OptionalprefixOptional SVG icon content to display before the input.
Should be a Lucide SVG inner-content string
(e.g. UIIcons.Lucide.Text.AtSign).
OptionalsuffixOptional SVG icon content to display after the input.
OptionalonCalled when the user clicks the prefix icon.
Current raw text value.
OptionalonCalled when the user clicks the suffix icon.
Current raw text value.
OptionaltoOptional display formatter.
When present, the native input element shows the string returned by
this method instead of the raw toValue result. Use this to
add locale-specific formatting (e.g. thousands separators) while
keeping value() as the clean programmatic output.
The adapted value produced by toValue.
Formatted string to display in the input element.
Transform the raw text into the adapted value.
Called on every input event. The result is stored in the value model
and written back to the native input element, so the user sees the
adapted text. The original keystrokes are preserved in the text model.
Raw text from the input element.
Adapted value string (displayed in the field and emitted via value).
OptionalvalidateValidate the raw text and return a result indicating whether the current input is valid.
When present, UIInput exposes a valid signal and applies the
invalid host class when validation fails.
Raw text from the input element.
Validation result with valid flag and error messages.
Adapter interface for transforming raw text in a UIInput.
When an adapter is attached to
UIInput, the component exposes two models:text– the raw, unaltered string as typed by the uservalue– the processed string produced by toValue, also what is displayed in the native input elementThe
valuemodel is the primary output: it is the adapted version of the raw input and should be used by all consuming code (forms, bindings, persistence). Thetextmodel is a backing store that preserves the original keystrokes for adapters that need access to the unprocessed input (e.g. for validation or undo).Adapters may also provide prefix/suffix icons, respond to clicks on them, and expose validation via validate.
Example