Skip to content

Calender

Single Date

Empty State


html
<x-calendar data-icon="o-calendar" placeholder="Select Date"></x-calendar>

Pre-filled State


html
<x-calendar data-icon="o-calendar" selected-value="2024-09-09" placeholder="Select Date"></x-calendar>

Disabled Dates


html
<x-calendar data-icon="o-calendar" disabled-dates='["2024-10-09", "2024-10-08"]' placeholder="Select Date"></x-calendar>

Date Range

Empty State


html
<x-calendar data-icon="o-calendar" type="range" months-to-show="2" placeholder="Start Date - End Date"></x-calendar>

Pre-filled State


html
<x-calendar data-icon="o-calendar" selected-value="2024-09-09 to 2024-10-09" type="range" months-to-show="2" placeholder="Start Date - End Date"></x-calendar>

Date Style

Default


html
<x-calendar data-icon="o-calendar" placeholder="Select Date"></x-calendar>

Rounded


html
<x-calendar data-icon="o-calendar" placeholder="Select Date"></x-calendar>

The x-calendar component is a custom element for handling calendar inputs with a variety of configurable options. Below are the available attributes and their descriptions.

Attributes

AttributeTypeDefaultDescription
namestring""Specifies the name for the calendar input. Useful for form submissions.
heightstring""Defines the height of the calendar component.
disabledbooleanfalseDisables the calendar input if set.
fixed-dropdownbooleanfalseWhen true dropdown will be fixed on the screen
data-iconstringundefinedAdds an icon to the calendar component. Specify the icon name.
show-indicatorboolean"false"Determines if an indicator should be shown. Set to "true" to display.
idstring""Unique identifier for the calendar component.
placeholderstring""Placeholder text for the calendar input field.
requiredboolean"false"Marks the input as required. Set to "true" to enable.
dropdown-widthstring"max-content"Sets the width of the dropdown calendar.
classstring""CSS classes to be applied to the calendar component.
selected-valuestring""The initially selected item, e.g 2020-09-10.
typestring"single"Defines the selection type. Options: "single" or "range".
months-to-shownumber2Number of months to display in the calendar view.
date-stylestring""Additional styling for the date cells. "rounded" or ""
disabled-datesarray[]Dates to be disabled, specified in JSON format.