For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/components/input.md.
v0.0.57
  • English
  • Input

    Data Entry@rockshin/tao-ui

    Single-line text input for short freeform values.

    When to use

    Use Input for short text values such as names, filters, search terms, and identifiers.

    Recommended

    • Pair with FormField for labels and validation.
    • Use type, inputMode, and autoComplete when applicable.

    Avoid

    • Do not use the component outside its intended interaction model.

    Examples

    Basic usage

    TSX

    Variants

    TSX

    Sizes and affixes

    USD
    TSX

    Three sizes

    Choose a size for regular forms, compact toolbars, or spacious layouts.

    TSX

    Clear and count

    Clearing calls onChange and onClear. Controlled values remain owned by your state.

    6 / 24
    tao-ui
    TSX

    Prefixes and suffixes

    Affixes show units or context while the input value contains only user data.

    https://.com
    $USD
    TSX

    Password input

    The visibility button supports keyboard access, disabled state, and controlled visibilityToggle.

    TSX

    Search input

    Button clicks, Enter and clearing call onSearch with source input or clear. IME confirmation and loading do not submit a search.

    No search yet
    TSX

    Native constraints and read-only

    Use native email, required, maxLength, and readOnly; application state decides error feedback.

    TSX

    Cursor placement

    The ref remains the native input. InputRef also exposes input, nativeElement and extended focus options.

    TSX

    Custom counting

    count.max warns by default. strategy and exceedFormatter can count and clip Unicode code points. Native maxLength counts UTF-16 code units independently.

    14 / 5
    2 / 5
    TSX

    Text area

    Input.TextArea is the same component as standalone Textarea, with auto sizing, clearing, counting and Enter events.

    0 / 120
    TSX

    One-time code

    Supports automatic advance, pasting, arrow keys, Backspace, formatting and masking. onInput returns an array including empty slots; onChange fires only when complete.

    -
    Enter all characters
    TSX

    Attached content

    addonBefore / addonAfter attach labels; prefix / suffix sit inside the input area.

    https://.com
    TSX

    API

    Input / Input.TextArea

    Other props pass through to the native input / textarea. Input.TextArea does not accept prefix, suffix or addons; standalone Textarea remains compatible.

    PropTypeDefault
    value / defaultValueNative input value / textarea value—
    onChange(event) => void—
    allowClearboolean or { clearIcon?, disabled?, tabIndex? }false
    onClear() => void—
    showCountboolean or { formatter: ({ value, count, maxLength }) => ReactNode }false
    count{ max?, strategy?: (value) => number, show?: boolean or formatter, exceedFormatter?: (value, { max }) => string }—
    onPressEnter(event: KeyboardEvent) => void—
    size'small', 'medium', 'large'TaoProvider
    variant'outlined', 'filled', 'borderless', 'underlined'TaoProvider
    status / error'error' or 'warning' / boolean—
    disabled / readOnlybooleanTaoProvider / false
    prefix / suffixReactNode (Input only)—
    addonBefore / addonAfterReactNode (Input only)—
    autoSizeboolean or { minRows?, maxRows? } (TextArea only)false
    classNames / stylesSemantic part map or ({ props }) => map—

    A count limit does not clip unless count.exceedFormatter is set. Clipping waits for IME composition to finish. count.show takes precedence over showCount. Input semantic parts: root / input / prefix / suffix / clear / count / addonBefore / addonAfter. TextArea: root / textarea / clear / count.

    Input.Password

    Inherits Input props.

    PropTypeDefault
    visibilityToggleboolean or { visible?, onVisibleChange?, tabIndex? }true
    iconRender(visible: boolean) => ReactNodeEye icon

    Input.Search

    Inherits Input props. The search button does not submit a surrounding form; onSearch reports source input or clear.

    PropTypeDefault
    enterButtonReactNode (boolean, label, native button or Button)false
    searchIconReactNodeSearch icon
    loadingbooleanfalse
    onSearch(value, event?, info?: { source: 'input' or 'clear' }) => void—
    classNames / stylesInput parts plus button—

    Input.OTP

    PropTypeDefault
    lengthPositive integer6
    value / defaultValuestring—
    formatter(value: string) => string—
    onInput(value: string[]) => void—
    onChange(value: string) => void (complete values)—
    maskboolean or stringfalse
    separatorReactNode or (index: number) => ReactNode—
    type / inputMode / autoCompleteNative input attributestext / — / —
    autoFocus / disabledbooleanfalse / TaoProvider
    size / variant / statusSame as InputTaoProvider / TaoProvider / —
    classNames / stylesroot / input / separator map or ({ props }) => map—

    Ref

    Input, Password and Search refs remain HTMLInputElement; TextArea remains HTMLTextAreaElement. Exported InputRef / TextAreaRef types add focus({ preventScroll, cursor: 'start' | 'end' | 'all' }), blur(), nativeElement and input / textArea. Native types without selection support only receive focus. OTPRef exposes focus(), blur() and nativeElement.

    The API follows local Ant Design 6.7.0 while retaining tao-ui native refs, theming and semantic DOM contracts; it is not a drop-in antd replacement. Deprecated bordered, prefixCls and antd component-global configuration are not supported. Set underlined through the local Input-family variant prop.