Calendar
A calendar component for selecting dates and date ranges.
Usage
Calendar Props
| Prop | Type | Default |
|---|---|---|
numberOfMonths | number | - |
captionLayout | string | - |
loadingData | boolean | - |
dateInfo | Record<string, ReactNode> | - |
showOutsideDays | boolean | - |
className | string | - |
timeZone | string | - |
RangePicker Props
The RangePicker supports customizing the popover behavior using the popoverProps prop.
| Prop | Type | Default |
|---|---|---|
dateFormat | string | "DD/MM/YYYY" |
onSelect | ((range: { from: Date; to: Date; }) => void) | - |
defaultValue | { from: Date; to: Date; } | - |
value | { from: Date; to: Date; } | - |
calendarProps | CalendarProps | - |
inputFieldsProps | { startDate?: InputFieldProps | undefined; endDate?: InputFieldProps | undefined; } | - |
children | ReactNode | - |
showCalendarIcon | boolean | true |
footer | ReactNode | - |
timeZone | string | - |
popoverProps | PopoverContentProps | - |
DatePicker Props
The DatePicker supports customizing the popover behavior using the popoverProps prop.
| Prop | Type | Default |
|---|---|---|
dateFormat | string | "DD/MM/YYYY" |
inputFieldProps | InputFieldProps | - |
value | Date | - |
onSelect | ((date: Date) => void) | - |
calendarProps | CalendarProps | - |
children | ReactNode | - |
showCalendarIcon | boolean | true |
timeZone | string | - |
popoverProps | PopoverContentProps | - |
Examples
Calendar
Choose between different variants to convey different meanings or importance levels. Default variant is accent.
Custom Date Information
You can display custom components above each date using the dateInfo prop. The keys should be date strings in "dd-MM-yyyy" format, and the values are React components that will be rendered above the date number.
Range Picker
The Range Picker component allows selecting a date range with the following behaviors:
-
When selecting two different dates:
- The UI will show the exact selected dates
- The callback will return the start and end date as selected
-
When clicking the same date twice:
- The UI will show the same date for both start and end
- The callback will return the start and end date as selected
Date Picker
Badges can include an icon to provide additional visual context. By default there is no icon.