shadcn.io is not affiliated with official shadcn/ui
Framework
UI library
Radix UI does not include this primitive, so this page uses the Ark UI component. The visuals match the Ark UI version.
mm/dd/yyyy
Installation
bunx --bun shadcn@latest add https://kit.dev/r/radix/date-input.jsonAnatomy
DateInput
└── DateInputLabel
├── DateInputControl
├── DateInputSegmentGroup
├── DateInputSegment
└── DateInputHiddenInputUsage
import { DateInput } from "@/components/ui/date-input";const Example = () => <DateInput className="w-full max-w-64" />;Accessibility
| Key | Description |
|---|---|
ArrowLeft | Move left. |
ArrowRight | Move right. |
ArrowUp | Move up. |
ArrowDown | Move down. |
PageUp | Jump backward. |
PageDown | Jump forward. |
Backspace | Delete backward. |
Delete | Delete backward. |
Home | Go to the start. |
End | Go to the end. |
Demos
Context
Controlled
Custom Separator
Default Value
Disabled
Granularity
Invalid
Leading Zeros
Min Max
Range
Read Only
Root Provider
Size Lg
Size Md
Size Sm
Time Only
With Clear Button
With Field
API Reference
DateInput
div
PropType
AttributeType
DateInputLabel
label
PropType
AttributeType
DateInputControl
div
PropType
childrenReact.ReactNodeAttributeType
DateInputSegmentGroup
div
PropType
index?numberAttributeType
DateInputSegment
span
PropType
AttributeType
DateInputHiddenInput
input
PropType
index?numbername?stringAttributeType
DateInputRootProvider
div
PropType
AttributeType