DatePicker
A button that opens a Calendar popup.
Import
import { DatePicker } from "@tarve/core";Usage
import { DatePicker } from "@tarve/core";
let open = false;
let month = "2026-09";
let date: string | undefined;
<DatePicker
open={open}
month={month}
value={date}
placeholder="Pick a date"
onOpenChange={(next) => {
open = next;
}}
onMonthChange={(next) => {
month = next;
}}
onValueChange={(next) => {
date = next;
open = false;
}}
/>Props
| Prop | Type | Default |
|---|---|---|
month required | string | — |
open required | boolean | — |
disabled | boolean | — |
formatValue | (date: string) => string | defaultDatePickerLabel |
isDateDisabled | (date: string) => boolean | — |
max | string | — |
min | string | — |
onMonthChange | (month: string) => void | — |
onOpenChange | (open: boolean) => void | — |
onValueChange | (date: string) => void | — |
placeholder | string | "Pick a date" |
value | string | — |
weekStartsOn | CalendarWeekStartsOn | 0 |
Common props
Shared by every component. See descriptions →
childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyleTypes
type CalendarWeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;