With description
Supporting text sits under the field and describes it.
<Field>
<Field.Label>Password</Field.Label>
<Input type="password" />
<Field.Description>At least 8 characters.</Field.Description>
</Field>Collects single-line text, with search mode offering a clear button and live result count.
<Field>
<Field.Label>Name</Field.Label>
<Input placeholder="Ada Lovelace" />
</Field>pnpm add @usefragments/uiImport styles once from @usefragments/ui/styles. See the installation guide for framework and theme setup.
Supporting text sits under the field and describes it.
<Field>
<Field.Label>Password</Field.Label>
<Input type="password" />
<Field.Description>At least 8 characters.</Field.Description>
</Field>The danger edge with the reason under the field.
<Field invalid>
<Field.Label>Email</Field.Label>
<Input type="email" defaultValue="invalid-email" />
<Field.Error match>Enter a valid email address.</Field.Error>
</Field>A filter with a clear button, Escape to clear and a live count.
<Input
type="search"
aria-label="Filter components"
placeholder="Filter"
count="3 of 71"
shortcut="/"A dashed edge: the value can be read and copied, not changed.
<Field>
<Field.Label>Repository</Field.Label>
<Input defaultValue="acme/web" readOnly />
</Field>Four heights on the control track: 24, 28, 32, 40.
<Stack gap="sm">
<Input aria-label="Extra small" size="xs" />
<Input aria-label="Small" size="sm" />
<Input aria-label="Medium" size="md" />
<Input aria-label="Large" size="lg" />
</Stack>A prefix and a suffix inside the field.
<Field>
<Field.Label>Price</Field.Label>
<Input startAdornment="$" endAdornment="USD" placeholder="0.00" />
</Field>Prop | Type | Default | Description |
|---|---|---|---|
count | string | undefined | Not set | type="search" only: how many match ("3 of 40"), announced politely while there is a query |
defaultValue | string | undefined | Not set | Initial value for uncontrolled use |
endAdornment | React.ReactNode | Not set | Content after the text: a glyph, a suffix or an action |
invalid | boolean | undefined | false | The danger edge and aria-invalid; say why in a Field.Error. Inside a Field, the Field's invalid does the same |
onValueChange | ((value: string) => void) | undefined | Not set | Called with the new value on every change, the clear button and Escape included |
shortcut | string | undefined | Not set | A keyboard shortcut hint drawn at the end. Display only: the app owns the shortcut |
size | InputSize | undefinedxssmmdlg | "md" | Field height on the shared control track: 24, 28, 32 or 40 |
startAdornment | React.ReactNode | Not set | Content before the text: a glyph or a prefix |
type | InputType | undefinednumbersearchtexttelurlemailpassword | text | Native input type. search adds a leading glyph, a clear button, Escape to clear then leave, and the count slot |
value | string | undefined | Not set | Current input value (controlled) |
placeholder | string | undefined | Not set | Placeholder text shown when empty |
disabled | boolean | undefined | false | Dims the field and blocks input |
readOnly | boolean | undefined | false | Shows the value on a dashed edge without letting it change |
onChange | ChangeEventHandler<HTMLInputElement> | undefined | Not set | The native change event |
className | string | undefined | Not set | Class on the field box |
onKeyDown | KeyboardEventHandler<HTMLInputElement> | undefined | Not set | — |