The project type will be added automatically
Project Title is required
Project title is required
Unavailable.
Disabled is required
With leading icon is required
npx shadcn@latest add https://sdk-components.thesqd.com/r/input.jsonimport {
TextField,
TextareaField,
NumberInput,
FileSizeInput,
TagsInput,
DurationInput,
RepeatableInput,
} from "@/components/ui/input";import { SearchIcon } from "lucide-react";
import { TextField } from "@/components/ui/input";
export function Example() {
return (
<TextField
label="Project title"
placeholder="Enter project title…"
caption="The project type will be added automatically."
iconLeading={SearchIcon}
required
/>
);
}TextField (label + caption + input in one component)
├── Label (renders if `label` is passed)
├── Caption (renders if `caption` is passed — under the label)
├── (iconLeading) (lucide icon component)
├── <input>
├── (iconTrailing) (lucide icon component)
└── error (rendered below the control in red)
TextareaField (same surface, multi-line + optional character count)
FileSizeInput (width × height + unit selector)
TagsInput (chip list driven by Enter / Tab / , / paste)
DurationInput (segmented d/h/m/s field, value in total seconds)The project type will be added automatically
Project Title is required
Project title is required
Unavailable.
Disabled is required
With leading icon is required
Full name is required
Your unique identifier
Username is required
Validates format on blur.
Email address is required
US format auto-applies as you type.
Phone number is required
Must be at least 8 characters
Password is required
Website is required
Amount is required
Search is required
Handle is required
3- or 4-digit account number.
Member # is required
Maximum 50 seats per workspace.
Quantity must be at least 1.
Output: {"h":null,"w":null,"unit":"in"}
Output: {"h":null,"w":null,"unit":"px"}
Click the pencil to split into editable cards; ✓ to converge.
Tell us a bit about yourself.
Uses Chrome's Web Speech API — button hides in other browsers.
This field is required
Press Enter / Tab / , to add. Backspace to remove the last tag.
The fourth tag is silently rejected.
Total: 7384s
Click + to add another URL. Outputs a string[].
This field is required
Min 2, max 5.
This field is required
This field is required
TextField
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Renders an associated <Label> above the input. |
caption | string | — | Helper copy shown below the input. Hidden when `error` is set. |
error | string | — | Error message — toggles the red focus ring + red helper line. |
required | boolean | — | Marks the label with a red asterisk. |
iconLeading | ComponentType<{ className?: string }> | — | Lucide icon component rendered inside the leading slot. |
iconTrailing | ComponentType<{ className?: string }> | — | Lucide icon component rendered inside the trailing slot. |
type | "text" | "email" | "tel" | "password" | "url" | "number" | "search" | … | "text" | Native HTML type. `email` and `tel` get blur-time validation hooks. |
invalidMessage | string | — | Error message to surface when the built-in email/tel validator rejects the value. |
onValidityChange | (valid: boolean) => void | — | Fires with the result of the email/tel validator on blur. |
TextareaField
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Renders an associated <Label> above the textarea. |
caption | string | — | Helper copy shown below the textarea. |
error | string | — | Error message — toggles the red treatment. |
rows | number | 3 | Initial visible row count. |
showCharacterCount | boolean | — | Render a live character count in the trailing slot. |
characterCount | number | — | Override the displayed character count. |
trailingContent | ReactNode | — | Custom node rendered below-right (e.g. dictation button). |
NumberInput
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Controlled value. |
defaultValue | number | 0 | Uncontrolled initial value. When value is 0 the input displays empty (placeholder shown). |
onValueChange | (value: number) => void | — | Fires with the parsed numeric value on every change. |
min | number | — | Lower bound — decrement button disables when reached. |
max | number | — | Upper bound — increment button disables when reached. |
step | number | 1 | Amount added/subtracted per stepper click. |
placeholder | string | "0" | Placeholder shown when the value is 0 or empty. |
caption | ReactNode | — | Helper copy shown below the input via FieldHint. Hidden when `error` is set. |
error | boolean | string | — | Error state. `true` applies the destructive ring only; a string also renders the inline message (`text-xs mt-1.5 text-red-500`) below the input. |
disabled | boolean | — | Dims the field and prevents interaction. |
FileSizeInput
| Prop | Type | Default | Description |
|---|---|---|---|
value | { width, height, unit } | — | Controlled value. Width and height are number | "" — unit is one of in/cm/mm/px/pt. |
onChange | (value) => void | — | Fires whenever any of the three sub-fields change. |
allowedUnits | Array<"in" | "cm" | "mm" | "px" | "pt"> | — | Restrict the unit dropdown — defaults to all five. |
id | string | — | Forwarded to the width input for label association. |
TagsInput
| Prop | Type | Default | Description |
|---|---|---|---|
value | string[] | — | Controlled tag list. |
onChange | (value: string[]) => void | — | Fires whenever a tag is added or removed. |
max | number | — | Cap the chip count. Extras are silently rejected. |
placeholder | string | — | Placeholder rendered inside the draft input. |
caption | string | — | Helper text below the field. |
DurationInput
| Prop | Type | Default | Description |
|---|---|---|---|
units | Array<"d" | "h" | "m" | "s"> | ["h","m","s"] | Which segments to render, left-to-right. |
value | number | — | Controlled value in total seconds. |
defaultValue | number | 0 | Uncontrolled initial value in total seconds. |
onValueChange | (totalSeconds: number) => void | — | Fires with the parsed total seconds on every change. |
disabled | boolean | — | Dims the field and prevents interaction. |
RepeatableInput
| Prop | Type | Default | Description |
|---|---|---|---|
value | string[] | — | Controlled list of row values. The component outputs `string[]`. |
defaultValue | string[] | — | Uncontrolled initial list. Padded with empty strings up to `min`. |
onChange | (value: string[]) => void | — | Fires whenever a row is added, removed, or edited. |
type | HTMLInputType | "text" | Input type for every row — forwarded to the underlying TextField. |
placeholder | string | — | Placeholder applied to each row's input. |
min | number | 1 | Minimum number of rows. The remove button hides when at the floor. |
max | number | — | Optional maximum. The + button disables once reached. |
label | string | — | Renders the field label above the stack of inputs. |
caption | string | — | Helper text rendered directly under the label. |
error | string | — | Error message — toggles the red treatment on the first row. |
required | boolean | — | Marks the label with a red asterisk. |
disabled | boolean | — | Dims every row and disables the +/− buttons. |