Picker-styled date

A set of five decorative, self-contained date pickers (SimpleDatePicker, RangeDatePicker, GlassDatePicker, InlineDatePicker, IconDatePicker) that share the ai2 token system, use framer-motion for panel animation, and are sized sm to xl. They render a real combobox trigger and a month-grid calendar with no Radix, native input, portal, or Intl dependency.

componentstyleddateregistry-item.json
Picker-styled date
LIVE · running in a sandboxed iframe
Installed with shadcn add · 2 workarounds · theme from registry.json
  • applied the registry's theme (tokens, fonts and CSS from the registry preview settings)
  • installed base item https://ai2.design/r/tokens.json (registry preview settings)
See how it was built

Installation

pnpm dlx shadcn@latest add @ai2/date-picker-styled

Requires @ai2 in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { SimpleDatePicker } from '@/components/ui/date-picker-styled'<SimpleDatePicker size='md' placeholder='Pick a date' />
  • Use a date input that matches a design system's tokens and needs a styled, polished look without extra dependencies beyond motion and lucide-react.
  • Use RangeDatePicker when the user must choose a start and end date in a single trigger.
  • Use GlassDatePicker over colorful or image backgrounds where a translucent frosted surface fits the design.
  • Use InlineDatePicker when the calendar should always be visible on the page, such as in a settings or booking card.

Examples

Uncontrolled SimpleDatePicker with a default date

Seeds the initial selection with defaultValue and lets the component manage its own state.

uncontrolled-simpledatepicker-with-a-default-date.tsx
import { SimpleDatePicker } from '@/components/ui/date-picker-styled'export function Example() {  return <SimpleDatePicker defaultValue={new Date(2025, 2, 14)} size='md' />}

Controlled SimpleDatePicker

Stores the selected date in React state and reads it through value and onChange.

controlled-simpledatepicker.tsx
import * as React from 'react'import { SimpleDatePicker } from '@/components/ui/date-picker-styled'export function Example() {  const [date, setDate] = React.useState<Date | undefined>(undefined)  return <SimpleDatePicker value={date} onChange={setDate} placeholder='Due date' />}

RangeDatePicker at xl size

A range trigger that fills in start and end dates across two clicks and closes after the end date is set.

rangedatepicker-at-xl-size.tsx
import { RangeDatePicker } from '@/components/ui/date-picker-styled'export function Example() {  return <RangeDatePicker size='xl' placeholder='Pick a trip range' />}

InlineDatePicker in a card

Shows the calendar permanently with a label above it that displays the selected date.

inlinedatepicker-in-a-card.tsx
import { InlineDatePicker } from '@/components/ui/date-picker-styled'export function Example() {  return <InlineDatePicker size='sm' placeholder='No date chosen' />}

API reference

PropTypeDefaultDescription
classNamestring—Extra classes merged onto the outer wrapper (for SimpleDatePicker, GlassDatePicker, IconDatePicker and RangeDatePicker) or onto the inline card (InlineDatePicker).
sizeStyledSize ("sm" | "md" | "lg" | "xl")"md"Trigger height and text size: sm h-8 text-sm, md h-9 text-sm, lg h-10 text-base, xl h-12 text-base. InlineDatePicker uses its label at text-xs for sm and md and text-sm for lg and xl.
placeholderstring"Pick a date" (Simple, Glass, Icon); "Pick a range" (Range); "Selected date" (Inline)Text shown in the trigger or inline label when no date is selected.
valueDate—Controlled selected date. For RangeDatePicker it seeds the start date. When provided, the component does not manage its own selection state.
defaultValueDate—Initial selected date for uncontrolled use. For RangeDatePicker it seeds the start date.
onChange(d: Date) => void—Called with the picked day. For RangeDatePicker it is called on every click, including the start date and then the end date.

Accessibility

  • The trigger is a button with role="combobox", aria-expanded reflecting open state, and aria-haspopup="grid".
  • The calendar body uses role="grid" and each day is a button with role="gridcell" and aria-selected set for the selected day (and both ends in RangeDatePicker).
  • Previous and next month buttons have aria-label values "Previous month" and "Next month".
  • Escape closes the open panel, and pointerdown outside the wrapper closes it as well (not applicable to InlineDatePicker, which has no panel).
  • Focus-visible rings use ring-[3px] ring-ring/50 on the trigger, nav buttons, and day buttons.
  • Under prefers-reduced-motion, panel animation is reduced to a short fade.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Picker-styled date" component (ai2/date-picker-styled) from its shadcn registry.1. Install it with: npx shadcn@latest add @ai2/date-picker-styled2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: className, size, placeholder, value, defaultValue, onChange.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { SimpleDatePicker } from '@/components/ui/date-picker-styled'<SimpleDatePicker size='md' placeholder='Pick a date' />```

Files & dependencies

  • registry/ai2/styled/date-picker-styled.tsx→ components/ui/date-picker-styled.tsx
dependenciesmotion@^12.42.2lucide-react@^1.23.0
registryDependencies@ai2/tokens

Looks similar, elsewhere