Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Date Input for React and Tailwind

Segmented input for dates and times.

mmddyyyy

Installation

bunx --bun shadcn@latest add https://kit.dev/r/date-input.json

Anatomy

DateInput
└── DateInputLabel
    ├── DateInputControl
    ├── DateInputSegmentGroup
    ├── DateInputSegment
    └── DateInputHiddenInput

Usage

import { DateInput } from "@/components/ui/date-input";
const Example = () => <DateInput className="w-full max-w-64" />;

Accessibility

KeyDescription
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
AttributeType

DateInputSegmentGroup

div

PropType
AttributeType

DateInputSegment

span

PropType
AttributeType

DateInputHiddenInput

input

PropType
AttributeType

DateInputRootProvider

div

PropType
AttributeType