Skip to content

Calendar - Web Component

The Calendar component can be used imported from:

Playground

Parameters

The Web component uses the <z-calendar> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
modelstringThe selected date.
first-weekdaystringThe first day of the week.
calendar-typestringThe calendar type.
localestringThe localization attribute.

Events

This component has events. Check the documentation about how to use the events.

NamePayloadDescription
changestringFires when the selected date changes.
restartedvoidEmitted on value reset

Parameters use

model

By defining the value prop, you can set the initial value of the input.

first-weekday

By defining the first-weekday prop, you can set the first day of the week. Possible values are sunday and monday. If not defined, the default value is monday.

calendar-type

By defining the calendar-type prop, you can set the type of the calendar.

locale

Attention!

The localization format of the input comes from the format settings of the client's operation system.

By defining the locale prop, you can set the locale of the calendar. If not defined, the default will be the browser's locale.

The calendar component it's highly customizable. You can use the --z-calendar--header--bg, --z-calendar--header--color, --z-calendar--bg, --z-calendar--color and --z-calendar--radius to customize the background and color of the header, the background and color of the calendar, and the radius of the calendar.

Browser support

Detected engine:  

  • Chromium

  • Webkit

  • Gecko

HTML Examples

CodeSandbox example