Date Picker

A date near today, like a due date or settlement, typed in the locale's format or picked from the calendar the icon opens, in the same box and states as Input. Built on ui-sdk's Date Picker: a typed date commits on Enter or blur, and the value is an ISO date.

BetaReady to use. Its API can still change in a minor release; the changelog says when.

import { DatePicker, DateRangePicker, Field } from "@leap-crm/design-system";

Playground

Change a prop and the component follows. Its code is under Props.

Props

placeholder
clearable
size
disabled

Best practices

When to use it, and the rules that apply in particular places.

GuidancePractice
DoUse it for dates near today, like a due date, a settlement or a follow-up, where seeing the week around the date helps.
DoUse DateRangePicker with presets for reporting windows, like this month or the last 30 days, so the common range is one click.
DoSet clearable when the date is optional, so a lawyer can remove it without typing over it.
Don'tUse it for a date of birth, an incorporation date or a date read off a document. Use DateInput: typing the date is faster than paging back decades.
Don'tPut two date pickers side by side for a start and an end. Use DateRangePicker, which keeps the end after the start.

Props

Also takes ui-sdk's Date Picker options: value, defaultValue, onValueChange, min, max, unavailable, locale, open, onOpenChange, closeOnSelect, name, required, disabled and readOnly.

DatePicker

PropTypeDefaultDescription
sizeTextSize"md"xs 28, sm 32, md 36 (forms, the default), lg 40, as Input.
placeholderstring—Shown while the field is empty. The locale's own pattern, like dd/mm/yyyy, when left out.
clearablebooleanfalseShows a × that empties the field.
aria-labelstring—Names the field outside a Field.
idstring—The control's id, for a label's htmlFor or aria-describedby.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

DateRangePicker

PropTypeDefaultDescription
valueDateRange | null—The range as [start, end] ISO dates, or null. Pass it to control the picker.
defaultValueDateRange | null—The range it starts with, as two ISO dates, when it controls itself.
onValueChange(value: DateRange | null) => void—Runs once both ends are set, or with null when cleared.
presetsDateRangePreset[]—Ranges one press away, listed beside the calendar, like "Last 7 days".
sizeTextSize"md"xs 28, sm 32, md 36 (forms, the default), lg 40, as Input.
placeholderstring—Shown in each empty input. The locale's own pattern when left out.
clearablebooleanfalseShows a × that empties the field.
aria-labelstring—Names the range outside a Field: the inputs read "<label>, start" and "<label>, end".
idstring—The control's id, for a label's htmlFor or aria-describedby.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

Code

What the playground shows, ready to copy.

import { DatePicker } from "@leap-crm/design-system";

<DatePicker aria-label="Due date" />

In a field

Type 12/12/2026 or press the calendar. The locale decides the order: en-AU reads day first. For a date people know by heart, like a date of birth, use Date Input: no calendar to page back through.

When the funds change hands.

States

Please enter a valid date

Range

DateRangePicker: the start, a dash and the end in one field. Pick the start in the calendar, then the end; the band fills between them. The value is [start, end] and changes once both are set.

Range with presets

presets lists ranges one press away beside the calendar; the matching one shows as selected.

What the examples share

The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.

import { Fragment } from "react";

import { DatePicker, DateRangePicker, Field } from "@leap-crm/design-system";

const sizes = ["xs", "sm", "md", "lg"] as const;

Keyboard

The keys it answers to. Tab moves between components, arrows move within them.

KeysWhat they do
EnterMakes a date typed in the page's format the value.
EnterSpaceOn the calendar button, opens the calendar with focus on the selected date.
Arrow keysMove by day and by week in the open calendar.
EscapeCloses the calendar and returns focus to its button.