Calendar
Calendar component, an inline month grid with single and range selection, min and max dates, disabled days, locale support and keyboard navigation.
How to use it
Run npx @blossomui/react add calendar, or copy src/components/UI/Calendar/Calendar.tsx into your React project and import it.
import { Calendar } from './components/ui/Calendar'
Props
CalendarLabels
| Prop | Type | Description |
|---|
| previousMonth (required) | string | |
| nextMonth (required) | string | |
DateRange
| Prop | Type | Description |
|---|
| start (required) | Date | null | |
| end (required) | Date | null | |
CalendarSingleProps
| Prop | Type | Description |
|---|
| mode | 'single' | `single` chooses one day, `range` chooses a first and a last day. |
| value | Date | null | |
| defaultValue | Date | null | |
| onChange | (date: Date) => void | |
CalendarRangeProps
| Prop | Type | Description |
|---|
| mode (required) | 'range' | |
| value | DateRange | |
| defaultValue | DateRange | |
| onChange | (range: { start: Date; end: Date }) => void | Called once both days are chosen. |