AhaSlides Design
v0.52.0React · Vue · Lit

Components · Data Entry

DatePicker

Pick a date or a date range from a calendar — schedules, deadlines, filters — rendered through the shared DatePicker.

Examples

API

PropTypeDefaultNotes
valueDayjs | [Dayjs, Dayjs]Selected date (or range for RangePicker)
pickerdate | week | month | quarter | yeardateGranularity
sizesmall | middle | largemiddleField height — 24 / 32 / 40
statuserror | warningValidation state on the field
showTimeboolean | objectfalseAdd a time picker to the panel
allowClearbooleantrueShow the clear affordance when a value is set
presets{ label, value }[]Quick ranges (RangePicker) — reporting windows
disabledbooleanfalseDisable the field
formatstringYYYY-MM-DDDisplay/parse format
disabledDate(d) => booleanConstrain selectable dates
onChange(date) => voidFires with the new date(s)

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/datepicker-theme';   // registers <datepicker>

Agent feed for this component (absolute, fetchable anywhere): datepicker.agent.json · datepicker.md · datepicker.llms.txt

When to use

When to use
  • DatePicker — a single date — a deadline, a start date
  • RangePicker — a start and end together — a reporting window, a schedule
  • Input — a free-form date the user already knows precisely — but prefer the picker for validity
Pre-fill a sensible default (today, or the current period) rather than empty. Constrain impossible dates with disabledDate instead of validating after the fact. Dates use Day.js.
Surfaces
editor dashboard settings

Spec

Field height 32 · radius 8 · 1px #E3E3E3 border · Selected cell brand #6A1EBB · In-range brand-tint #F9F5FF · Hover cell #F7F7F7 (gray-20) · Placeholder #8A8A8A