Skip to content
Uxelith
Sign in
Prov1.0.0Forms

Date Picker

Single dates and ranges in a keyboard-first calendar, with one-tap presets ("Last 7 days"), months that slide the way you go, min/max, unavailable days and ISO strings for forms.

Installs with Uxelith ProHow
Licence
Pro
Packages
2
Updated
10 Oct 2026
Live

Installation

Usage

example.tsx
"use client"

import { useState } from "react"
import { DatePicker, type DateRange } from "@/components/date-picker"

export function Booking() {
  const [stay, setStay] = useState<DateRange>({ from: null, to: null })
  return (
    <div className="flex gap-4">
      <DatePicker label="Delivery date" name="delivery" disableWeekends />
      <DatePicker label="Your stay" mode="range" months={2} value={stay} onValueChange={setStay} />
    </div>
  )
}

Props

PropTypeDefaultDescription
labelstring—Visible label and accessible name.
mode"single" | "range""single"One date, or a first and last day.
value / defaultValuestring | null · { from, to }— / nullISO dates, e.g. "2026-10-10".
onValueChange(value) => void—Called with the new date or range.
min / maxstring—Earliest and latest choosable dates.
disableWeekendsbooleanfalseRule out Saturdays and Sundays.
isDateDisabled(date: string) => boolean—Rule out any other dates.
months1 | 21Months side by side (two on wide screens).
inlinebooleanfalseShow the calendar on the page instead of in a popover.
weekStartsOn0 | 11Sunday or Monday first.
localestringvisitor'sMonth and day names.
placeholderstring"Pick a date"Trigger text before a choice.
namestring—Form field; a range submits "2026-10-10/2026-10-17".
presets{ label, value }[]—Quick choices beside the calendar; value is a date, a range, or a function of today.
hideLabel / disabledbooleanfalseVisually hidden label; disabled trigger.
--date-accent / --date-accent-foregroundCSS variable--primary / --primary-foregroundSelected day colours.

Accessibility

  • WAI-ARIA date picker: the calendar is a grid; arrows move by day and week, Home/End to the week's ends, PageUp/PageDown by month (Shift: by year).
  • Each day is announced in full, with "today" and "unavailable" where they apply; the month heading is a polite live region.
  • Opening focuses the chosen day or today; Escape closes and returns focus to the trigger.
  • Unavailable days stay focusable (so the grid can be explored) but can't be chosen; they're also struck through, not only dimmed.
  • Month changes slide; instantly under prefers-reduced-motion.
  • Presets are a labelled group of buttons, the active one marked with aria-pressed.

Changelog

  1. v1.0.0Latest

    First release.

More in Forms

All 10 in Forms
  • FormsFree

    Animated Input

    A text field whose label floats out of the way, with examples that take turns while it's empty, an error that shakes once, a tick for a valid value and sent text that drifts away.

  • FormsPro

    File Dropzone

    Drop, paste or browse for files: the zone lights up as a file crosses the page and warns before a wrong type lands; files show thumbnails and upload with live, cancellable progress.

  • FormsPro

    Multi Select

    Pick several options from a searchable list: chips pop in and slide aside as others leave, matches are highlighted, and creatable turns it into a tag input. Limits, icons and forms.