type | 'text' | 'password' | 'email' · default 'text'The HTML input type. |
|---|
label | string · requiredLabel text for the input: always rendered for accessibility. |
|---|
value | string · requiredCurrent value of the input. |
|---|
onChange | (value: string, e: ChangeEvent<HTMLInputElement>) => voidCallback fired when the input value changes. |
|---|
changeAction | (value: string, e: ChangeEvent<HTMLInputElement>) => void | Promise<void>Async action fired after onChange (if not prevented). Triggers optimistic update and shows a loading spinner while pending. |
|---|
size | 'sm' | 'md' | 'lg' · default 'md'Size variant of the input. |
|---|
isLabelHidden | boolean · default falseVisually hides the label while keeping it accessible to screen readers. |
|---|
description | stringDescription text displayed between the label and input. |
|---|
isOptional | boolean · default falseDisplays an "Optional" indicator next to the label. Mutually exclusive with isRequired. |
|---|
isRequired | boolean · default falseDisplays a "Required" indicator next to the label and sets aria-required. Mutually exclusive with isOptional. |
|---|
onEnter | () => voidCallback fired when the user presses the Enter key. IME-safe: Enter used to commit a Japanese/Chinese/Korean conversion does not fire it. |
|---|
onKeyDown | (e: KeyboardEvent<HTMLInputElement>) => voidCallback fired on keydown events on the input. |
|---|
isDisabled | boolean · default falseDisables the input, preventing interaction and dimming the element. |
|---|
isReadOnly | boolean · default falseMakes the input read-only: the value is shown at full opacity and still submits with the form, but cannot be edited. Unlike isDisabled, a read-only input is not dimmed and stays in the tab order. isDisabled takes precedence when both are set. |
|---|
disabledMessage | stringExplains why the input is disabled. With isDisabled, shows a tooltip on hover/keyboard focus and keeps the input focusable via aria-disabled (the field becomes read-only). Use this instead of wrapping a disabled TextInput in Tooltip. Disabled controls swallow the hover events an external Tooltip needs. |
|---|
isLoading | boolean · default falsePuts the input in a loading state, showing a spinner and setting aria-busy. |
|---|
placeholder | stringPlaceholder text shown when the input is empty. |
|---|
labelTooltip | stringTooltip text displayed in an info icon at the end of the label. |
|---|
startIcon | IconTypeSVG icon component displayed at the start of the input. See astryx docs icons for valid semantic names. |
|---|
status | {type: 'error' | 'warning' | 'success', message?: string}Validation status: applies a colored border and status icon. If message is provided, displays a floating message below the input. Error type also sets aria-invalid. |
|---|
statusVariant | 'attached' | 'detached' | 'tooltip' · default 'attached'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing; tooltip hides the message box and surfaces it in a tooltip on the status icon. |
|---|
hasClear | boolean · default falseShows a clear (×) button when the input has a value. Clicking it clears the value and returns focus to the input. |
|---|
hasAutoFocus | boolean · default falseAutomatically focuses the input on mount. |
|---|
htmlName | stringThe HTML name attribute for the input, useful for form submissions. |
|---|
width | SizeValueWidth of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned. |
|---|
autoComplete | stringThe native autocomplete attribute, forwarded to the input unchanged. Does not affect the controlled value. |
|---|