Input
Edit single-line text with native input events and Field integration.
Use Input for native single-line text editing. Compose it with Field for a label and validation message, or InputGroup for adjacent controls.
Basic usage#
Playground#
Anatomy#
Usage#
Native input behavior#
Input forwards native input attributes. Use value with onValueChange for controlled text and defaultValue for an initial uncontrolled value. readOnly keeps the field focusable without allowing edits; disabled removes it from interaction.
Composed controls#
Use InputGroup.Leading and InputGroup.Trailing for static context such as an icon or unit. Password visibility, clearing, copying, and loading remain application behavior: compose buttons and icons into these parts and provide their labels and handlers.
Examples#
Leading and trailing content#
Form integration#
Attributes#
data-disabledSlot: inputDescription: Present when the component, slot, or item is disabled.data-invalidSlot: inputDescription: Present when the field or form has a validation error.data-readonlySlot: inputDescription: Present when the field is in read-only mode.data-requiredSlot: inputDescription: Present when the field input is required.Props#
Props for the Input component. Renders a <input> element by default.