Input — dir/ui
A single-line control for text, numbers, money, percentages, dates and times.
# Input
A single-line control for text, numbers, money, percentages, dates and times.
Live preview of every variant and state: https://ui.usedir.com/components/input
## Install
```sh
npx shadcn@4.21.0 add lr-run/dir-ui/input#v0.4.0
```
[Registry item with source and dependencies](https://github.com/lr-run/dir-ui/blob/v0.4.0/registry.json)
Requires React 19, Tailwind CSS 4 and shadcn initialized with Base UI: npx shadcn@4.21.0 init --base base --preset base-nova (in Vite, set up the @/* path alias in tsconfig.json and vite.config.ts first). Registry target placeholders resolve through components.json: @ui, @components, @hooks and @lib. Imports below use the conventional @/ prefix for illustration; the CLI rewrites them to your configured aliases. Shared components are installed once through registryDependencies. The installer merges shared theme rules into the stylesheet configured in components.json. Existing files are never forcibly overwritten; review CLI conflicts before accepting changes. No Dir runtime is required.
## Input, type InputProps, type InputType
```tsx
import { Input, type InputProps, type InputType } from '@/components/ui/input.tsx'
```
| Prop | Type | Default / required | Notes |
| --- | --- | --- | --- |
| value / defaultValue | string \| number \| readonly string[] | — | |
| onChange | ChangeEventHandler<HTMLInputElement> | — | |
| disabled / invalid | boolean | false | |
| id / name / placeholder | string | — | |
| ref | Ref<HTMLInputElement> | — | |
| type | 'text' \| 'email' \| 'tel' \| 'url' \| 'password' \| 'search' \| 'number' \| 'money' \| 'percent' \| 'date' \| 'datetime-local' | text | |
| currency | string | USD | Currency label for type="money". |
| min / max / step | number \| string | — | Native constraints for numeric and date inputs. |
Money and percent use the same numeric input with an adornment. Percent values are percentage points (60 = 60%). Date and datetime-local compose a calendar popover with editable native inputs. Dates use YYYY-MM-DD; local timestamps use YYYY-MM-DDTHH:mm. Alt+ArrowDown opens the calendar. Picking a day preserves the time (09:00 for an empty timestamp). min/max constrain the calendar; required disables Clear date. The disabled prop is the shared non-editable state. Other native input attributes are forwarded.