Input
A native input that pairs with Field and matches Button’s four control sizes.
Installation
npx shadcn@latest add @navui/inputUsage
Choose a native type and autocomplete value for the data you need. Use a visible label in forms, or provide an accessible name when the surrounding context already identifies the input.
import { Input } from "@/components/navui/input";
export function WorkEmail() {
return (
<Input
name="email"
aria-label="Work email"
type="email"
autoComplete="email"
placeholder="you@example.com"
/>
);
}Examples
Default input
Sizes
Pair Input’s controlSize with NavUI Button’s size to align both controls.
Native input types
Email, URL, telephone, and number inputs keep their native keyboards and controls. This example uses NavUI Field for labels.
Disabled and read-only
Tab to the read-only value to select and copy it. Both inputs use NavUI Field for their labels.
With an action button
Rename the project by pressing Enter or selecting Rename. The example uses NavUI Field and Button.
API reference
Foundation component styled on UI SDK Input. See the UI SDK Input documentation for the complete inherited API.
| Prop | Type | Default | Description |
|---|---|---|---|
controlSize | "xs" | "sm" | "default" | "lg" | "default" | Sets the input height to 24, 28, 32, or 40 pixels. Match Button and SelectTrigger’s size prop to align them. The native numeric size attribute remains available. |
Accessibility
- Give each input a visible label where possible. A placeholder is only a hint.
- Use readOnly for values people may need to focus, copy, or submit. Use disabled to exclude a control from keyboard navigation and form submission.