Date Field

Loading...

Installation

Install the component via the CLI in one command.

npx shadcn@latest add @intentui/date-field

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.

npm install react-aria-components tailwind-merge

Examples

Date time field

You can also use the date field to select both date and time.

Loading...

Validation

When validation is applied, the date field will show a validation message if the entered value is invalid.

Loading...

Controlled

In a controlled date field, the value must be passed as a prop, and the field is not directly editable by the user.

Loading...

Uncontrolled

In a controlled date field, the value must be passed as a prop, and the field is not directly editable by the user.

Loading...

Readonly

In a readonly date field, the value is provided as a prop, and the field is not editable by the user.

Loading...

Disabled

A disabled date field is non-interactive and visually represented in a disabled state.

Loading...

Component API

DateField

The DateField component lets users enter a date with segmented fields.

PropTypeDefault
classNamestring-

DateInput

The DateInput component renders the segmented date input.

PropTypeDefault
classNamestring-

See the React Aria for the full API reference.