Input
Allows users to type single-line text, emails, passwords, or numbers, with clear focus outlines and validation feedback.
2.5 KB
•Updated on August 21, 2026
Installation
Bash
pnpm dlx shadcn@latest add @spaceui/primitives-inputUsage
Code
import { Input } from '@/components/ui/input'Code
<Input />Features
Sizes
Input fields in sm, default, and lg sizes.
Disabled
Input rendered in a disabled state via disabled.
Read Only
Input configured in read-only mode via readOnly.
API Reference
Input
Styled wrapper for Input from Base UI with custom size options.
| Prop | Type | Default | Description |
|---|---|---|---|
size | sm|default|lg|number | default | Controls the input height. Number values are passed to the native size attribute |
unstyled | boolean | false | When true, removes the wrapper styling (border, shadow, etc.) |
nativeInput | boolean | false | When true, renders directly as a native input element without field control wrappers |
Examples
File input
Input with label
Input with button using Group
Input with start text and end tooltip
Password input with toggle visibility
Input group with keyboard shortcut
Input group with start loading spinner
Input with label and required indicator
Input with optional label
Input with custom border and background
Input group with end loading spinner
Input with characters remaining counter
Pill-shaped input