Skip to content
Magma Design System
Input date range<mds-input-date-range>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".accessibleNamearia-labelstring | undefinedThe accessible name of the range: each of the two fields is named after it and after the end of the range it covers, the visible “from” and “to” labels living in this shadow root, where no IDREF of the slotted fields could reach them.
delay - number500Specifies the delay in milliseconds before closing the calendar dropdown, if the value is 0 the dropdown will not close
disabled - boolean | undefinedfalseDisables the range, like a disabled native input: the dates cannot be changed, from the fields or from the calendar, and are left out of the form. It disables the two slotted fields too. A disabled <fieldset> around the component does the same.
dualCalendardual-calendarbooleanfalseEnables the linked dual-calendar range picker behavior.
endDateend-datestringSpecifies the end date of the range
hideTodayhide-todaybooleanfalseHides the highlight on today’s date in the calendar.
max - null | stringnullSpecifies the max date of the range, user cannot set dates after this date
min - null | stringnullSpecifies the min date of the range, user cannot set dates before this date
name - string | undefinedIs needed to reference the form data after the form is submitted
size - lg | md | sm | undefinedlgSpecifies the height of the field, the same as mds-button: sm 28px, md 36px, lg 48px
startDatestart-datestringSpecifies the start date of the range
Events
mdsInputDateRangeValueChange{ startDate: string; endDate: string; }Emitted when the selected start or end date changes.
Methods
preselectpreselect(event: EventDate) => Promise<void>Applies the given preselection range to the input.
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="calendar-preselection".calendar-preselectionAdd HTML elements or components to this slot.
endAdd HTML elements or components to this slot.
startAdd HTML elements or components to this slot.