Skip to content
caliper ui docs

Pro

Date input

A date field you type into, with the reading shown live and a month that carries data marks.

Pro
pnpm dlx shadcn@latest add @caliper/date-input

Schedule a payout

€12,480.00 from Halden Analytics to Nordbank ••42

Try “next fri”, “14 oct” or “in 2 weeks”.

Payout lands by 17:00 on 2026-10-16.

Installs components/ui/date-input.tsxDepends on @radix-ui/react-popover, lucide-reactMotion none in component source

When to use

Use it for

  • Scheduling where typing “next fri” beats clicking through months.
  • Dates where some days carry data (invoices due) or are unavailable for a reason.

Skip it when

  • People mostly browse a month; use the date picker or calendar.

Decisions

Why it is built this way, so you know what to keep when you change your copy.

Behaviour

It shows what it read before it commits
Typed text such as “next fri” or “in 2 weeks” is read back in mono under the field, and Enter commits it, so a misread date is caught before it is saved.

Usage

Let people type
Most dates are faster to type than to pick. Keep the calendar for browsing and the field for knowing.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/date-input

Adds its 6 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source. It is built from DateInput and parseNaturalDate.

example.tsx
import { DateInput, parseNaturalDate } from "@/components/ui/date-input"

The worked example comes with Pro

The 39-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

DateInput

component
PropTypeDefaultDescription
label *string—
valuestring | null—
defaultValuestring | nullnull
onValueChange((value: string | null) => void)—
disabledDates((iso: string) => boolean)—
disabledReason((iso: string) => string | undefined)—
marks((iso: string) => string | undefined)—
hintstring"Try “next fri”, “14 oct” or “in 2 weeks”."
namestring—
classNamestring—
todayDate—The date relative words are read against; defaults to now.

parseNaturalDate

component

No props of its own; it accepts the native props of its root element.

Accessibility

It is built on native elements and keeps aria-invalid, aria-describedby, aria-label, aria-hidden and aria-live in step with state. Changes that matter are announced through a live region.

KeyBehaviour
EnterActivates the focused control.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Dates examples