TextInput
Render a single-line Astryx text input.
Astryx Props
JSON-safe TextInput props forwarded to Astryx.
Supported Astryx props include:
type('text' or 'password' or 'email'): The HTML input type.label(string; required): Label text for the input: always rendered for accessibility.value(string; required): Current value of the input.onChange((value: string, e: ChangeEvent<HTMLInputElement>) => void): Callback fired when the input value changes.changeAction((value: string, e: ChangeEvent<HTMLInputElement>) => void or Promise<void>): Async action fired after onChange (if not prevented). Triggers optimistic update and shows a loading spinner while pending.size('sm' or 'md' or 'lg'): Size variant of the input.isLabelHidden(boolean): Visually hides the label while keeping it accessible to screen readers.description(string): Description text displayed between the label and input.isOptional(boolean): Displays an "Optional" indicator next to the label. Mutually exclusive with isRequired.isRequired(boolean): Displays a "Required" indicator next to the label and sets aria-required. Mutually exclusive with isOptional.isDisabled(boolean): Disables the input, preventing interaction and dimming the element.isLoading(boolean): Puts the input in a loading state, showing a spinner and setting aria-busy.placeholder(string): Placeholder text shown when the input is empty.labelTooltip(string): Tooltip text displayed in an info icon at the end of the label.startIcon(IconType): SVG icon component displayed at the start of the input. See 'npx astryx docs icons' for valid semantic names.status({type: 'error' or 'warning' or '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.hasClear(boolean): Shows a clear (x) button when the input has a value. Clicking it clears the value and returns focus to the input.hasAutoFocus(boolean): Automatically focuses the input on mount.htmlName(string): The HTML name attribute for the input, useful for form submissions.
Props typed as React nodes, render functions, event handlers, refs, or StyleX styles are documented for Astryx parity but cannot be serialized directly from Python unless the wrapper adapts them.
See Astryx component docs: https://astryx.atmeta.com/components/TextInput.
Functions
constructor__init__(value='', *, label='', label_position='top', label_width=None, placeholder='', disabled=False, input_type=None, size=None, label_hidden=None, description=None, optional=None, required=None, loading=None, status=None, clear=None, auto_focus=None, select_on_focus=None, **props) -> Noneparamvaluestr= ''Synchronized component value.
paramlabelstr= ''Visible or accessible label for the component.
paramlabel_positionstr= 'top'Place the label above the control or beside it in a compact row.
paramlabel_widthint | float | str | None= NoneWidth of a left-side label. Use the same width to align sibling controls.
paramplaceholderstr= ''Placeholder text shown when the control is empty.
paramdisabledbool= FalseWhether the component should render disabled.
paraminput_typestr | None= NoneHTML text input type.
paramsizestr | None= NoneInput size.
paramlabel_hiddenbool | None= NoneWhether to visually hide the accessible label.
paramdescriptionstr | None= NoneHelper text displayed with the input.
paramoptionalbool | None= NoneWhether to mark the field optional.
paramrequiredbool | None= NoneWhether to mark the field required.
paramloadingbool | None= NoneWhether to show the loading state.
paramstatusMapping[str, Any] | None= NoneValidation status record.
paramclearbool | None= NoneWhether to show a clear button.
paramauto_focusbool | None= NoneWhether to focus the input when mounted.
paramselect_on_focusbool | None= NoneWhether focusing the input selects its content, so typing replaces the value. Off by default for text inputs.
parampropsAny= {}Returns
None