datui
Color scheme

Forms

Input

Single-line native text input inside a FormField.

import { Input } from "datui";

Playground

<Input placeholder="Your name" status="default" mode="default" align="left" />

Examples

Controlled and uncontrolled

0 characters
€

Accessibility

  • A native <input>: all keyboard behavior is the browser's.
  • status="error" sets aria-invalid; inside FormItem the label and description are linked automatically.
  • Without a FormItem, pass aria-label or your own <label htmlFor>.

API

Input

Single-line text input inside a FormField. A native `<input>`: works controlled (`value` + `onChange(event)`) or uncontrolled (`defaultValue`), and `ref` points at the input.

PropTypeDefaultDescription
afterReactNode—Content after the control, e.g. an icon, clear button or unit.
afterAlignFormFieldSlotAlign"center"Vertical alignment of `after`.
alignTextAlignleftText alignment inside the field.
beforeReactNode—Content before the control, usually an icon.
beforeAlignFormFieldSlotAlign"center"Vertical alignment of `before`.
classNamestring—
modeFormFieldMode"default"`plain` removes border and background, e.g. for fields inside cells or toolbars.
sizeFormFieldSize"l"Minimum height, matching the control heights (`m` lines up with a default Button).
slotProps{ root?: (FormFieldProps & { ref?: Ref<HTMLDivElement>; }); } | undefined—Props for the FormField shell. `className` and `style` also go to the shell.
statusFormFieldStatus"default"Visual validation state. Pair `error` with `aria-invalid` on the control (FormItem does this).