- Prop
value- Type
Date | undefined- Default
- —
- Requirement
- optional
- Description
- —
Docs Components Forms
DatePicker
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
const datePickerFixture = { id: "datepicker", label: "Kickoff date", // Pinned for the same reason as calendarFixture: the trigger's mono readout // and the popover's today-ring must not move with the wall clock. selectedIsoDay: "2026-06-21", todayIsoDay: "2026-06-21",} satisfies { id: string; label: string; selectedIsoDay: string; todayIsoDay: string;}; /** * Turns a fixture's pinned `yyyy-mm-dd` string into the `Date` the calendar * adapters take. * * Fixtures stay plain JSON (the proof test rejects `Date` instances, and * `date` is a forbidden field name), but Calendar/DatePicker/DateRangePicker * are `Date`-valued — so the conversion lives here, once, instead of five * `new Date(...)` literals drifting apart in five demo files. * * Parsed field-by-field into *local* midnight on purpose: `new Date("2026-06-18")` * is parsed as UTC midnight, which renders as the 17th everywhere west of * Greenwich, so the demo month grid would highlight a different day depending * on the reader's timezone. Field-by-field construction pins the rendered * year/month/day in every timezone, forever. */function isoDayToDate(isoDay: string): Date { const [year, month, day] = isoDay.split("-").map(Number); return new Date(year!, month! - 1, day!);} import { DatePicker } from "@grassroot/ui-react"; export default function DatePickerDemo() { return ( <div> <DatePicker id={`${datePickerFixture.id}-react`} label={datePickerFixture.label} defaultValue={isoDayToDate(datePickerFixture.selectedIsoDay)} today={isoDayToDate(datePickerFixture.todayIsoDay)} /> </div> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script setup lang="ts">import { ref } from "vue";const datePickerFixture = { id: "datepicker", label: "Kickoff date", // Pinned for the same reason as calendarFixture: the trigger's mono readout // and the popover's today-ring must not move with the wall clock. selectedIsoDay: "2026-06-21", todayIsoDay: "2026-06-21",} satisfies { id: string; label: string; selectedIsoDay: string; todayIsoDay: string;}; /** * Turns a fixture's pinned `yyyy-mm-dd` string into the `Date` the calendar * adapters take. * * Fixtures stay plain JSON (the proof test rejects `Date` instances, and * `date` is a forbidden field name), but Calendar/DatePicker/DateRangePicker * are `Date`-valued — so the conversion lives here, once, instead of five * `new Date(...)` literals drifting apart in five demo files. * * Parsed field-by-field into *local* midnight on purpose: `new Date("2026-06-18")` * is parsed as UTC midnight, which renders as the 17th everywhere west of * Greenwich, so the demo month grid would highlight a different day depending * on the reader's timezone. Field-by-field construction pins the rendered * year/month/day in every timezone, forever. */function isoDayToDate(isoDay: string): Date { const [year, month, day] = isoDay.split("-").map(Number); return new Date(year!, month! - 1, day!);} import { DatePicker } from "@grassroot/ui-vue";const selected = ref(isoDayToDate(datePickerFixture.selectedIsoDay));const today = isoDayToDate(datePickerFixture.todayIsoDay);</script><template> <div> <DatePicker v-model="selected" :id="`${datePickerFixture.id}-vue`" :label="datePickerFixture.label" :today="today" /> </div></template>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Component } from "@angular/core";const datePickerFixture = { id: "datepicker", label: "Kickoff date", // Pinned for the same reason as calendarFixture: the trigger's mono readout // and the popover's today-ring must not move with the wall clock. selectedIsoDay: "2026-06-21", todayIsoDay: "2026-06-21",} satisfies { id: string; label: string; selectedIsoDay: string; todayIsoDay: string;}; /** * Turns a fixture's pinned `yyyy-mm-dd` string into the `Date` the calendar * adapters take. * * Fixtures stay plain JSON (the proof test rejects `Date` instances, and * `date` is a forbidden field name), but Calendar/DatePicker/DateRangePicker * are `Date`-valued — so the conversion lives here, once, instead of five * `new Date(...)` literals drifting apart in five demo files. * * Parsed field-by-field into *local* midnight on purpose: `new Date("2026-06-18")` * is parsed as UTC midnight, which renders as the 17th everywhere west of * Greenwich, so the demo month grid would highlight a different day depending * on the reader's timezone. Field-by-field construction pins the rendered * year/month/day in every timezone, forever. */function isoDayToDate(isoDay: string): Date { const [year, month, day] = isoDay.split("-").map(Number); return new Date(year!, month! - 1, day!);} import { GrassrootDatePicker } from "@grassroot/ui-angular";@Component({ selector: "app-date-picker-demo", standalone: true, imports: [GrassrootDatePicker], template: `<div> <grassroot-date-picker [id]="id" [label]="fixture.label" [defaultValue]="selected" [today]="today" /> </div>`,})export class DatePickerDemoComponent { protected readonly fixture = datePickerFixture; protected readonly id = `${datePickerFixture.id}-angular`; protected readonly selected = isoDayToDate(datePickerFixture.selectedIsoDay); protected readonly today = isoDayToDate(datePickerFixture.todayIsoDay);}export default DatePickerDemoComponent;- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script lang="ts"> const datePickerFixture = { id: "datepicker", label: "Kickoff date", // Pinned for the same reason as calendarFixture: the trigger's mono readout // and the popover's today-ring must not move with the wall clock. selectedIsoDay: "2026-06-21", todayIsoDay: "2026-06-21", } satisfies { id: string; label: string; selectedIsoDay: string; todayIsoDay: string; }; /** * Turns a fixture's pinned `yyyy-mm-dd` string into the `Date` the calendar * adapters take. * * Fixtures stay plain JSON (the proof test rejects `Date` instances, and * `date` is a forbidden field name), but Calendar/DatePicker/DateRangePicker * are `Date`-valued — so the conversion lives here, once, instead of five * `new Date(...)` literals drifting apart in five demo files. * * Parsed field-by-field into *local* midnight on purpose: `new Date("2026-06-18")` * is parsed as UTC midnight, which renders as the 17th everywhere west of * Greenwich, so the demo month grid would highlight a different day depending * on the reader's timezone. Field-by-field construction pins the rendered * year/month/day in every timezone, forever. */ function isoDayToDate(isoDay: string): Date { const [year, month, day] = isoDay.split("-").map(Number); return new Date(year!, month! - 1, day!); } import { DatePicker } from "@grassroot/ui-svelte";</script> <div> <DatePicker id={`${datePickerFixture.id}-svelte`} label={datePickerFixture.label} defaultValue={isoDayToDate(datePickerFixture.selectedIsoDay)} today={isoDayToDate(datePickerFixture.todayIsoDay)} /></div>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
/** @jsxImportSource solid-js */const datePickerFixture = { id: "datepicker", label: "Kickoff date", // Pinned for the same reason as calendarFixture: the trigger's mono readout // and the popover's today-ring must not move with the wall clock. selectedIsoDay: "2026-06-21", todayIsoDay: "2026-06-21",} satisfies { id: string; label: string; selectedIsoDay: string; todayIsoDay: string;}; /** * Turns a fixture's pinned `yyyy-mm-dd` string into the `Date` the calendar * adapters take. * * Fixtures stay plain JSON (the proof test rejects `Date` instances, and * `date` is a forbidden field name), but Calendar/DatePicker/DateRangePicker * are `Date`-valued — so the conversion lives here, once, instead of five * `new Date(...)` literals drifting apart in five demo files. * * Parsed field-by-field into *local* midnight on purpose: `new Date("2026-06-18")` * is parsed as UTC midnight, which renders as the 17th everywhere west of * Greenwich, so the demo month grid would highlight a different day depending * on the reader's timezone. Field-by-field construction pins the rendered * year/month/day in every timezone, forever. */function isoDayToDate(isoDay: string): Date { const [year, month, day] = isoDay.split("-").map(Number); return new Date(year!, month! - 1, day!);} import { DatePicker } from "@grassroot/ui-solid";export default function DatePickerDemo() { return ( <div> <DatePicker id={`${datePickerFixture.id}-solid`} label={datePickerFixture.label} defaultValue={isoDayToDate(datePickerFixture.selectedIsoDay)} today={isoDayToDate(datePickerFixture.todayIsoDay)} /> </div> );}Installation
API Reference
Import
import { DatePicker } from "@grassroot/ui-react";
Props
Prop
Type
Default
Requirement
Description
valueDate | undefined—
optional
—
defaultValueDate | undefined—
optional
—
onValueChange((date: Date) => void) | undefined—
optional
—
openboolean | undefined—
optional
—
onOpenChange((open: boolean) => void) | undefined—
optional
—
labelstring | undefined—
optional
—
placeholderstring | undefined—
optional
—
defaultOpenboolean | undefinedfalseoptional
Render initially open — handy for layout/stories.
todayDate | undefined—
optional
Override "today" for the hairline ring (testing/stories/demos).
localestring | undefined—
optional
Locale used for the visible date, month, and weekday labels.
dir"ltr" | "rtl" | undefined—
optional
Text direction.
weekStartsOnWeekStart | undefined—
optional
First weekday (0 = Sunday).
minDate | undefined—
optional
—
maxDate | undefined—
optional
—
- Prop
defaultValue- Type
Date | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onValueChange- Type
((date: Date) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
open- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onOpenChange- Type
((open: boolean) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
label- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
placeholder- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultOpen- Type
boolean | undefined- Default
false- Requirement
- optional
- Description
- Render initially open — handy for layout/stories.
- Prop
today- Type
Date | undefined- Default
- —
- Requirement
- optional
- Description
- Override "today" for the hairline ring (testing/stories/demos).
- Prop
locale- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- Locale used for the visible date, month, and weekday labels.
- Prop
dir- Type
"ltr" | "rtl" | undefined- Default
- —
- Requirement
- optional
- Description
- Text direction.
- Prop
weekStartsOn- Type
WeekStart | undefined- Default
- —
- Requirement
- optional
- Description
- First weekday (0 = Sunday).
- Prop
min- Type
Date | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
max- Type
Date | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
disabledDates- Type
readonly Date[] | undefined- Default
- —
- Requirement
- optional
- Description
- Calendar days unavailable for selection.
- Prop
disabled- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
readOnly- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
required- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
invalid- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
name- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
className- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
id- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
Events
| Event | Payload |
|---|---|
onValueChange | ((date: Date) => void) | undefined |
onOpenChange | ((open: boolean) => void) | undefined |
Import
import { ref } from "vue";
import { DatePicker } from "@grassroot/ui-vue";
Props
Prop
Type
Default
Requirement
modelValueDate | undefined—
optional
defaultValueDate | undefined—
optional
labelstring | undefined—
optional
placeholderstring | undefined"Pick a date"optional
openboolean | undefinedundefinedoptional
defaultOpenboolean | undefinedfalseoptional
todayDate | undefined—
optional
localestring | undefined—
optional
dir"ltr" | "rtl" | undefined—
optional
weekStartsOnWeekStart | undefined—
optional
minDate | undefined—
optional
maxDate | undefined—
optional
disabledDatesreadonly Date[] | undefined—
optional
disabledboolean | undefinedfalseoptional
- Prop
modelValue- Type
Date | undefined- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
Date | undefined- Default
- —
- Requirement
- optional
- Prop
label- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string | undefined- Default
"Pick a date"- Requirement
- optional
- Prop
open- Type
boolean | undefined- Default
undefined- Requirement
- optional
- Prop
defaultOpen- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
today- Type
Date | undefined- Default
- —
- Requirement
- optional
- Prop
locale- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl" | undefined- Default
- —
- Requirement
- optional
- Prop
weekStartsOn- Type
WeekStart | undefined- Default
- —
- Requirement
- optional
- Prop
min- Type
Date | undefined- Default
- —
- Requirement
- optional
- Prop
max- Type
Date | undefined- Default
- —
- Requirement
- optional
- Prop
disabledDates- Type
readonly Date[] | undefined- Default
- —
- Requirement
- optional
- Prop
disabled- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
readOnly- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
required- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
invalid- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
name- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
className- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
id- Type
string | undefined- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
update:modelValue | [date: Date] |
update:open | [open: boolean] |
Import
import { Component } from "@angular/core";
import { GrassrootDatePicker } from "@grassroot/ui-angular";
Props
Prop
Type
Default
Requirement
valueDate—
optional
defaultValueDate—
optional
openboolean—
optional
labelstring—
optional
placeholderstring"Pick a date"optional
defaultOpenbooleanfalseoptional
idstring—
optional
todayDate—
optional
localestring—
optional
dir"ltr" | "rtl"—
optional
weekStartsOnWeekStart—
optional
minDate—
optional
maxDate—
optional
disabledDatesreadonly Date[]—
optional
- Prop
value- Type
Date- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
Date- Default
- —
- Requirement
- optional
- Prop
open- Type
boolean- Default
- —
- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string- Default
"Pick a date"- Requirement
- optional
- Prop
defaultOpen- Type
boolean- Default
false- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
today- Type
Date- Default
- —
- Requirement
- optional
- Prop
locale- Type
string- Default
- —
- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl"- Default
- —
- Requirement
- optional
- Prop
weekStartsOn- Type
WeekStart- Default
- —
- Requirement
- optional
- Prop
min- Type
Date- Default
- —
- Requirement
- optional
- Prop
max- Type
Date- Default
- —
- Requirement
- optional
- Prop
disabledDates- Type
readonly Date[]- Default
- —
- Requirement
- optional
- Prop
disabled- Type
boolean- Default
false- Requirement
- optional
- Prop
readOnly- Type
boolean- Default
false- Requirement
- optional
- Prop
required- Type
boolean- Default
false- Requirement
- optional
- Prop
invalid- Type
boolean- Default
false- Requirement
- optional
- Prop
name- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
valueChange | Date |
openChange | boolean |
Import
import { DatePicker } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
valueDate—
optional
defaultValueDate—
optional
labelstring—
optional
placeholderstring"Pick a date"optional
defaultOpenbooleanfalseoptional
openboolean—
optional
todayDate—
optional
idstring—
optional
namestring—
optional
minDate—
optional
maxDate—
optional
disabledDatesreadonly Date[]—
optional
disabledbooleanfalseoptional
readOnlybooleanfalseoptional
- Prop
value- Type
Date- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
Date- Default
- —
- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string- Default
"Pick a date"- Requirement
- optional
- Prop
defaultOpen- Type
boolean- Default
false- Requirement
- optional
- Prop
open- Type
boolean- Default
- —
- Requirement
- optional
- Prop
today- Type
Date- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
name- Type
string- Default
- —
- Requirement
- optional
- Prop
min- Type
Date- Default
- —
- Requirement
- optional
- Prop
max- Type
Date- Default
- —
- Requirement
- optional
- Prop
disabledDates- Type
readonly Date[]- Default
- —
- Requirement
- optional
- Prop
disabled- Type
boolean- Default
false- Requirement
- optional
- Prop
readOnly- Type
boolean- Default
false- Requirement
- optional
- Prop
required- Type
boolean- Default
false- Requirement
- optional
- Prop
invalid- Type
boolean- Default
false- Requirement
- optional
- Prop
locale- Type
string- Default
- —
- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl"- Default
- —
- Requirement
- optional
- Prop
weekStartsOn- Type
0 | 1 | 2 | 3 | 4 | 5 | 6- Default
- —
- Requirement
- optional
- Prop
onValueChange- Type
(date: Date) => void- Default
- —
- Requirement
- optional
- Prop
onOpenChange- Type
(open: boolean) => void- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onValueChange | (date: Date) => void |
onOpenChange | (open: boolean) => void |
Import
import { DatePicker } from "@grassroot/ui-solid";
Props
Prop
Type
Default
Requirement
valueDate—
optional
defaultValueDate—
optional
onValueChange(date: Date) => void—
optional
labelstring—
optional
placeholderstring"Pick a date"optional
openboolean—
optional
defaultOpenbooleanfalseoptional
onOpenChange(open: boolean) => void—
optional
todayDate—
optional
localestring—
optional
dir"ltr" | "rtl"—
optional
weekStartsOnWeekStart—
optional
minDate—
optional
maxDate—
optional
- Prop
value- Type
Date- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
Date- Default
- —
- Requirement
- optional
- Prop
onValueChange- Type
(date: Date) => void- Default
- —
- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string- Default
"Pick a date"- Requirement
- optional
- Prop
open- Type
boolean- Default
- —
- Requirement
- optional
- Prop
defaultOpen- Type
boolean- Default
false- Requirement
- optional
- Prop
onOpenChange- Type
(open: boolean) => void- Default
- —
- Requirement
- optional
- Prop
today- Type
Date- Default
- —
- Requirement
- optional
- Prop
locale- Type
string- Default
- —
- Requirement
- optional
- Prop
dir- Type
"ltr" | "rtl"- Default
- —
- Requirement
- optional
- Prop
weekStartsOn- Type
WeekStart- Default
- —
- Requirement
- optional
- Prop
min- Type
Date- Default
- —
- Requirement
- optional
- Prop
max- Type
Date- Default
- —
- Requirement
- optional
- Prop
disabledDates- Type
readonly Date[]- Default
- —
- Requirement
- optional
- Prop
disabled- Type
boolean- Default
- —
- Requirement
- optional
- Prop
readOnly- Type
boolean- Default
- —
- Requirement
- optional
- Prop
required- Type
boolean- Default
- —
- Requirement
- optional
- Prop
invalid- Type
boolean- Default
- —
- Requirement
- optional
- Prop
name- Type
string- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onValueChange | (date: Date) => void |
onOpenChange | (open: boolean) => void |