Skip to content

DatePicker

A date picker component for selecting dates and date ranges.

import { useState } from 'react';
import { DatePicker } from '@fintech-sandpit/ui/react';
const [value, setValue] = useState<Date[]>([
new Date('2026-01-15'),
]);
return (
<DatePicker
value={value}
mode="single"
label="Select date"
placeholder="No date selected yet"
onChange={setValue}
/>
);
import { useState } from 'react';
import { DatePicker } from '@fintech-sandpit/ui/react';
const [value, setValue] = useState<Date[]>([
new Date('2026-01-01'),
new Date('2026-01-31'),
]);
return (
<DatePicker
value={value}
mode="range"
label="Select date range"
numOfMonths={2}
placeholder="No date range selected yet"
onChange={setValue}
/>
);
NameTypeDefaultDescription
valueDate[]The value of the date picker (controlled)
defaultValueDate[]Default value of the date picker (uncontrolled)
labelstringLabel under the date input
placeholderstringPlaceholder text
modeDatePickerSelectionMode'single'Selection mode
numOfMonthsnumber1Number of months to display
startOfWeeknumber1First day of the week (0 = Sunday, 1 = Monday, etc.)
minDateMin allowed date
maxDateMax allowed date
defaultViewDatePickerViewDefault view of the date picker
minViewDatePickerViewMin allowed view
maxViewDatePickerViewMax allowed view
orientationOrientation'vertical'Orientation of the text input
colorSchemeColorScheme'neutral'Color scheme
sizeSize'md'Size
formatstring'%D.%M.%Y'Format of the output date 1
timeZonestring'UTC'Time zone
clearablebooleanfalseWhether the input value can be cleared
requiredbooleanfalseWhether the input is required
invalidbooleanfalseWhether the input is invalid
readOnlybooleanfalseWhether the input is read only
disabledbooleanfalseWhether the input is disabled
closeOnSelectbooleanfalseWhether to close the popup after selecting a date
fixedWeeksbooleanfalseWhether to fix the number of weeks in the popup
lazyMountbooleanfalseWhether to lazy mount the popup window
presetsDatePickerPreset[]Date range presets 2
  1. Date formats are described on the FormatDate component page.
  2. Makes sense only in range mode.
NameArgumentsDescription
onValueChange(value: Date[]) => voidCallback fired when the value changes
type DatePickerSelectionMode = 'single' | 'multiple' | 'range'
type DatePickerView = 'day' | 'month' | 'year'
type DatePickerPreset = {
label: string;
value: (
| 'thisWeek'
| 'lastWeek'
| 'thisMonth'
| 'lastMonth'
| 'thisQuarter'
| 'lastQuarter'
| 'thisYear'
| 'lastYear'
| 'last3Days'
| 'last7Days'
| 'last14Days'
| 'last30Days'
| 'last90Days'
);
}
type ColorScheme = 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
type Orientation = 'horizontal' | 'vertical'
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'