Components
Input
Single-line text field with two variants and an icon, prefix and trailing content inside its border.
import { Input } from "@openperf/deft";
<Input.Root aria-label="Project name" name="name" placeholder="My project" />;Wrap the input in a Field for a visible label; without one, set aria-label.
When to use
| Need | Component |
|---|---|
| One line of free text | Input |
| Several lines | Textarea |
| One-time code | OTP input |
| A choice from known options | Select or Combobox |
Variants
| Variant | Notes |
|---|---|
default | Dialogs and standalone forms. |
field | Inset surfaces, such as settings rows in a List. |
Button, the Select trigger and Textarea have the same two variants, so the controls in one row can match.
Icon and trailing content
icon takes a Tabler icon component and draws it at 16px before the value. extra renders any node after the value: a unit, a copy button, a clear button.
Prefix
prefix is fixed muted text before the value and is not part of the value.
Search
With type="search" the browser's own clear button is hidden; add a reset button through extra if you need one.
Layout and states
The input is 28px tall and takes the full width of its container. className goes to the wrapper, which is where you set the width, while native props and ref go to the <input>. A click anywhere inside the border, including the icon and the prefix, focuses the input.
Inside an invalid Field the input shows a danger ring; a disabled input dims the whole control. The input gets a generated id unless you pass one, for example to target it from a label outside a field.
API
Prop
Type