ComponentsForm Blocks
Date Picker
A button-triggered date picker popover built on Calendar and Base UI Popover. Supports single, range, and multiple selection, preset shortcuts, stacked or sidebar preset layouts, footer slot, and min/max constraints.
Playground
Installation
pnpm add @tessinaui/ui react-day-pickerUsage
import { DatePicker, createRangePresets } from "@tessinaui/ui";{/* Single date */}
<DatePicker mode="single" selected={date} onSelect={setDate} />
{/* Date + time range with Apply button */}
<DatePicker
mode="range"
selected={range}
onSelect={setRange}
showDateTime
showTimezone
onApply={({ start, startTime, end, endTime }) => console.log({ start, startTime, end, endTime })}
/>
{/* Date range with presets sidebar */}
<DatePicker
mode="range"
selected={range}
onSelect={setRange}
presets={createRangePresets()}
presetsPosition="left"
numberOfMonths={2}
/>Showcase
API Reference
DatePicker props
Selection
| Prop | Type | Default | Description |
|---|---|---|---|
mode | "single" | "range" | "multiple" | "single" | Selection mode |
selected | Date | DateRange | Date[] | — | Controlled selection value |
onSelect | (value) => void | — | Called when selection changes |
Trigger
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder | string | "Pick a date" | Label shown when nothing is selected |
triggerVariant | ButtonProps["variant"] | "outline" | Trigger button variant |
triggerSize | ButtonProps["size"] | "sm" | Trigger button size |
triggerClassName | string | — | Extra classes for the trigger (e.g. "w-56") |
Calendar options
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | "md" | Calendar cell size |
numberOfMonths | number | 1 | Months shown inside the popover |
showWeekNumber | boolean | false | Show ISO week numbers |
showOutsideDays | boolean | true | Show adjacent month days |
fixedWeeks | boolean | false | Always render 6 rows |
fromDate | Date | — | Earliest selectable date |
toDate | Date | — | Latest selectable date |
disabled | Matcher | Matcher[] | — | Disable specific dates |
defaultMonth | Date | — | Default visible month |
Date & time
| Prop | Type | Default | Description |
|---|---|---|---|
showDateTime | boolean | false | Show built-in Start/End date inputs, time inputs, and Apply button below the calendar |
onApply | (data: DateTimeApplyData) => void | — | Called when the Apply button is clicked |
showTimezone | boolean | false | Show the detected local timezone below the Apply button |
interface DateTimeApplyData {
start?: Date;
startTime?: string; // "HH:MM"
end?: Date;
endTime?: string; // "HH:MM"
}Presets
| Prop | Type | Default | Description |
|---|---|---|---|
presets | PresetItem[] | — | List of preset shortcuts |
presetsPosition | "left" | "top" | "left" | "left" renders a sidebar; "top" renders pill chips above the calendar |
Layout
| Prop | Type | Default | Description |
|---|---|---|---|
footer | ReactNode | — | Slot rendered below the calendar (e.g. apply/clear buttons) |
rounded | "none" | "sm" | "md" | "lg" | "xl" | "full" | "lg" | Popover border radius |
align | "start" | "center" | "end" | "start" | Popover horizontal alignment relative to trigger |
side | "bottom" | "top" | "left" | "right" | "bottom" | Popover side |
dir | "ltr" | "rtl" | "ltr" | Text direction — RTL flips nav arrows and calendar layout |
className | string | — | Added to the outer wrapper <div> |
PresetItem type
interface PresetItem {
label: string;
getValue: () => Date | DateRange;
}Built-in preset helpers
import { createSinglePresets, createRangePresets } from "@tessinaui/ui";
// Single: Today, Yesterday, Last week
const singlePresets = createSinglePresets();
// Range: Today, Yesterday, Last 7 days, Last 30 days, Last 3 months
const rangePresets = createRangePresets();DateRange type
import type { DateRange } from "@tessinaui/ui";
interface DateRange {
from: Date | undefined;
to?: Date | undefined;
}NumberField
Numeric form input with stacked, split, inline or no increment/decrement buttons. Five sizes, five rounded values, full intent palette, three label positions, prefix/suffix slots, locale-aware formatting via Intl.NumberFormat, and LTR/RTL support.
Time Picker
Three time-picker variants — a drum-roll wheel, a typed HH:MM input field, and a button-triggered popover. Supports 12h/24h formats, seconds, configurable minute steps, all intent colours, RTL, and keyboard navigation.