Calendar
The <Calendar>
is a date selection interface that allows you to choose a date using a calendar view.
Anatomy
The <Calendar>
consists of a header and a grid section. Inside of the header there are two select lists, one for a month and one for the year. In the grid section there is a grid of selectable dates.

Appearance
The appearance of a component can be customized using the variant
and size
props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
Property | Type | Description |
---|---|---|
variant | - | The available variants of this component. |
size | - | The available sizes of this component. |
Usage
The <Calendar>
should be used for experiences where you need to visualize data over an entire month. For most other scenarios, especially where compact input or flexible validation is important, consider using <DatePicker>
or <DateField>
.
Follow form guidelines for
disabled
and readonly
state.
Accessibility
Calendar cells support keyboard navigation (through arrow keys) and selection (through enter or space), with localized screen reader messages provided to announce changes in selection and the visible date range.
aria-label
when using <Calendar>
to ensure screen readers have access to it.Localization
The <Calendar>
itself supports many different calendar systems, all based on the users locale system. You can override the locale system by using the <I18nProvider>
from @marigold/components
. With that you can use the locale
prop and set it to any language system.
Range calendar
With the minValue
and maxValue
property, you can set a range in which the date can be selected. This is useful if you need to limit the amout of calendar dates to select.
Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
Props
aria-describedby?
string;
aria-details?
string;
aria-label?
string;
aria-labelledby?
string;
autoFocus?
boolean;
"false"
children?
ReactNode |
((values: CalendarRenderProps & { defaultChildren: ReactNode }) => ReactNode);
createCalendar?
(identifier: CalendarIdentifier) => Calendar;
createCalendar
function
from @internationalized/date
will be used.dateUnavailable?
(date: DateValue) => boolean;
defaultFocusedValue?
DateValue | null;
defaultValue?
DateValue | null;
disabled?
boolean;
"false"
firstDayOfWeek?
"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat";
focusedValue?
DateValue | null;
id?
string;
maxValue?
DateValue | null;
minValue?
DateValue | null;
onChange?
(value: DateValue) => void;
onFocusChange?
(date: CalendarDate) => void;
readOnly?
boolean;
"false"
slot?
string | null;
null
value indicates that the local props completely override all props received from a parent.value?
DateValue | null;
width?
WidthProp;
Alternative Components
Consider the following alternatives for selecting data tailored to different user needs and input methods.
- DatePicker: The
<DatePicker>
allows users to input a date directly as text, in addition to selecting one, and offers more robust validation and error messaging capabilities. - DateField: Use the
<DateField>
if you need to only use text input to select a date.