npm install @idyeah/diya
GitHub
Appearance
Color scheme

Date Picker

Get code

Three steps. The first two happen once per app.

Step 1: Install

Terminal, in your app’s folder
npm install @idyeah/diya

Once per app. Every component and pattern is in this one package.

Working in Claude Code or Cursor? Connect your editor once and it fetches this for you.

No app yet? npm create diya@latest sets up Next.js or Vite with the styles and provider already in place. Then skip to step 3.

Step 2: Add the styles and provider

Once, at your app’s root: app/layout.tsx in Next.js, src/main.tsx in Vite. DIYA Sans comes with it.

Root layout or entry
import '@idyeah/diya/styles.css'
import { DiyaProvider } from '@idyeah/diya'

<DiyaProvider theme="dark">
  {children}
</DiyaProvider>

theme="dark" matches the catalog as you’re viewing it. theme="system" follows each visitor’s light or dark setting instead.

Get theme

Your brand as one CSS file and a few props.

Brand
AaAaNeutral (DIYA default)
Font
DIYA Sans
Corners · Elevation
Soft · Soft
Control height · Fields
Default · Auto
Glass
Off
Motion
Match device
Status colors
DIYA defaults

Step 1: Save the theme file

diya-theme.css · 6 lines
/* diya-theme.css, made in the DIYA catalog.
   Import it after '@idyeah/diya/styles.css'. Public tokens only.
   Brand: Neutral (DIYA default). */

/* No color, corner or elevation changes: DIYA's defaults apply. */

Public tokens only: the names DIYA promises not to rename in 1.x.

Step 2: Import it after DIYA’s styles

Root layout or entry
import '@idyeah/diya/styles.css'
import './diya-theme.css'

Order matters. The theme goes second so it wins.

Type
Size
Options
State

Select the dates for your project.

Using Date Picker

A labeled date field that opens a calendar popup; picks one ISO date, or a start and end date with range.

A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.

When to use

For a date or a start and end date, picked from a calendar.

A date far in the past, like a birthday? A plain Text Input is often quicker.

Accessibility

The field is a button that opens the calendar. There, arrow keys move by day and week, Page Up and Page Down by month, and Escape closes it.

Props

import { DatePicker } from '@idyeah/diya'Stable since 1.0.0

labelRequiredstring

Visible label above the field; also names the trigger for assistive tech. Hide it with hideLabel.

disabledboolean

Prevents opening the calendar and dims the field.

Default false

errorstring

Visible error message below the field; marks it invalid while set.

helperTextstring

Visible hint below the field, announced with it; error replaces it while set.

hideLabelboolean

Hides the label visually but keeps it as the trigger's accessible name.

Default false

isDateUnavailable(date: string) => boolean

Called with each ISO YYYY-MM-DD day on show; return true to mark the day unavailable (announced, and it can't be chosen), as with min and max.

maxstring

Latest date that can be chosen, as ISO YYYY-MM-DD; later days show as unavailable.

minstring

Earliest date that can be chosen, as ISO YYYY-MM-DD; earlier days show as unavailable.

namestring

Form field name: the chosen date is sent with the form under it (in range mode, the start and then the end).

rangeboolean

Single-date mode (the default): leave unset or false. Range mode: the first click sets the start, the second the end (swapped if earlier).

size"small" | "medium" | "large"

Trigger height and type size; defaults to 'medium'.

Default 'medium'

When range={false} (the default)

defaultValuestring

The initially chosen ISO date when uncontrolled; a form reset returns to it.

onValueChange(value: string) => void

Called with the chosen ISO YYYY-MM-DD date, or '' when cleared.

valuestring

The chosen date as ISO YYYY-MM-DD, or '' for none, when controlled; pair it with onValueChange.

When range={true}

defaultValueDateRange

The initially chosen range when uncontrolled; a form reset returns to it.

onValueChange(value: DateRange) => void

Called with the new range after each click; end is '' until the second date is chosen.

valueDateRange

The chosen range as ISO YYYY-MM-DD dates, a bound '' while unset, when controlled; pair it with onValueChange.

Also takes every native <button> attribute, such as name, id or data-*.