Skip to content
Magma Design System
Calendar<mds-calendar>Generated from @maggioli-design-system/magma@2.3.0dist/documentation.json. Encapsulation: shadow.
Magma components are web components: custom elements you write like HTML tags, with any framework or without one. Props configure them, events tell you what happened, methods are functions you call on the element and slots take the content you put inside it.
Props
Set a prop as an HTML attribute in the markup, or as a property from JavaScript. The Attribute column gives the name of the attribute, a dash when it is the same as the property; props without one, such as arrays and functions, are set from JavaScript only. To turn a boolean attribute off, remove it: never write disabled="false".disableMonthYearSelectiondisable-month-year-selectionbooleanfalseDisables switching to month or year selection views from the calendar header.
endDateend-datenull | stringnullSpecifies the end date of the selection
hideNextButtonhide-next-buttonbooleanfalseIf set, the component hides the next navigation button in the calendar header.
hidePreselectionhide-preselectionbooleanfalseIf set, the component hides the preselection area above the calendar view even when the preselection slot has content.
hidePreviousButtonhide-previous-buttonbooleanfalseIf set, the component hides the previous navigation button in the calendar header.
hideTodayhide-todaybooleanfalseHides the highlight on today’s date in the calendar view.
hoverDatehover-datenull | stringnullSpecifies the date used to preview the range selection across multiple visible calendars.
max - null | stringnullSpecifies the minimum date of the selection
min - null | stringnullSpecifies the minimum date of the selection
singlePickersingle-pickerbooleanfalseIf set, the component selects a single date instead of a date range (start and end date).
startDatestart-datenull | stringnullSpecifies the start date of the selection
viewDateview-datenull | stringnullSpecifies the date used to determine the visible month without changing the selection.
Events
mdsCalendarChange{ startDate: string; endDate?: string | undefined; }Emitted when the selected date or date range changes.
mdsCalendarHover{ hoverDate: string | null; }Emitted when the user hovers over a day, used to preview a range selection.
mdsCalendarNavigate{ currentDate: string; delta: number; }Emitted when the user navigates to a different month or year.
mdsCalendarPreselectvoidEmitted when the calendar’s preselection options need to be re-evaluated.
Methods
updateCurrentDateupdateCurrentDate(date: string) => Promise<void>Sets the calendar’s current date and re-renders the calendar accordingly.
Slots
Slots take the content you write between the tags of the component. Content for a named slot goes on a direct child with the name of the slot in its slot attribute, such as slot="preselection".preselectionAdd HTML elements or components shown in the calendar preselection area.