Skip to main content

Calendar

A general-purpose calendar component supporting day, month, and year views — useful for date selection and scheduling interfaces.

Usage Playground

Sun
Mon
Tue
Wed
Thu
Fri
Sat
Size
small
medium
large
Date Picker Mode
single
multiple
range
Show Adjacent Month Days
Disable Future Dates
Disable Past Dates
Display Date Format
Output Date Format
Code Snippet
import { Calendar } from "@react-native-blossom-ui/dates";

function Usage() {
return (
<Calendar/>
);
}

Usage

Sun
Mon
Tue
Wed
Thu
Fri
Sat
function CalendarUsage() {
const [date, setDate] = useState<Date | undefined>()

return (
<View>
<Calendar
selectedDate={date}
onDateChange={(data) => {
if (data.mode === 'single') {
setDate(data.date as Date)
}
}}
/>
</View>
)
}

Props

PropData TypeDefault ValueDescription
ExtendsBaseUIProps--Inherits properties from BaseUIProps
selectedDatestring | Date--The default selected date.Can be a string (formatted date) or a Date object.
selectedDates(string | Date)[]--The default selected dates for `"multiple"` date selection mode.Can be an array of strings (formatted dates) or Date objects.
selectedEndDatestring | Date--The default selected end date for `"range"` date selection mode.Can be a string (formatted date) or a Date object.
disableDates(string | Date)[]--An array of disabled dates of string (in outputDateFormat) or a Date object.Make sure to provide the outputDateFormat prop too if passing date as string
onDateChange(data: CalendarDateChange) => void--Callback triggered when a date is selected. Receives a mode-aware, type-safe payload.
yearListPropsPick<YearListProps, "minYear" | "maxYear">--Props for configuring the year list (min and max year).
containerStyleStyleProp<ViewStyle>--The outer most container style for the calendar.This can be used to set padding, margin, etc.
statusBlossomStatusprimaryStatus of the component to apply color variants'primary' | 'accent' | 'success' | 'info' | 'warning' | 'error'
sizeBlossomSizemediumSize of the component'small' | 'medium' | 'large'
datePickerModeDatePickerModesingleSelection mode for the date picker.single - single date selection multiple - multiple date selection range - range date selection
showAdjacentMonthDaysbooleantrueWhether to show days from adjacent months to fill the weeks.If true, days from the previous and next months will be displayed to fill the calendar grid.
minDatestring | Date--minimum selectable date inclusive.Can be a string (in `outputDateFormat`) or a Date object.
maxDatestring | Date--maximum selectable date inclusive.Can be a string (in `outputDateFormat`) or a Date object.
disableFutureDatesboolean--Disable future dates
disablePastDatesboolean--Disable past dates
disabledDaysOfWeeknumber[]--disable the given days of the week,from 0 (Sunday) to 6 (Saturday).
displayDateFormatstring'D MMM YYYY'The format in which the date should be displayed inside the input value Checkout the dayjs docs for all available formats - https://day.js.org/docs/en/display/format
outputDateFormatstring'DD-MM-YYYY'The format in which the selected date should give outputAnd this format should be used whenever you are passing any date to this component Checkout the dayjs docs for all available formats - https://day.js.org/docs/en/display/format