Skip to content
HomeCobalt

Date picker

Holds a day, a start and an end, or several days in a form field that opens a calendar to pick them and sends them with the form.

Examples

A filter field that opens a calendar below it; picking a day closes it, and Clear empties it.
Mode multipleSeveral study days in one field, each press adding a day or taking it away, until Done closes the calendar.

Up to five days. A desk is held for you from 9am on each one.

Mode rangeCheck-in and check-out in one field, with the nights counted as you point and check-out allowed on the morning a booked night begins.

$145.00 a night.Struck-through nights are booked.

Mode singleOne day, shown in the field in the reader's own words.
PresetsLast 30 days, This quarter or Year to date in one press beside the calendar, and the field names the range.

Holdings reports and offering notices filed in this range.

TypedType the report date in your own format or pick it, and a date that cannot be read says so below the calendar.

Holdings are shown as filed on this day. Type 9/30/2025, Sep 30 2025 or 2025-09-30.

In a fieldThe label names the field, and the description says what the day changes.

Holdings are shown as filed on this day.

States

Set when the contract was signed.

DisabledA disabled field keeps its date at half opacity and does not open.
Choose a check-in date to see the price.
InvalidThe red wash on the field and the error that names the fix.

Usage

Use it when

  • A form or filter field for a day, such as a check-in date or "filed on or after".
  • A stay or a reporting period, a start and an end in one field.
  • Several separate days in one field, such as the days a desk is booked.

Use something else when

  • A calendar that is the page's main content, always in view. Use Calendar instead.
  • Only a few named periods and never days of your own, such as a chart's 1M, 3M, 1Y. Use SegmentedControl instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/date-picker.json
import { DatePicker, datePresets, type DatePreset } from "@/components/cobalt/ui/date-picker"