Calendar The Calendar component displays events in a visual date grid in a week views, allowing users to view and interact with the displayed events.
import { VCalendar } from '@vonage/vivid-api-vue' ;
import { VCalendar } from '@vonage/vivid-api-vue' ;
< VCalendar class= "calendar" />
import { registerCalendar } from '@vonage/vivid-api' ;
registerCalendar ( 'your-prefix' );
import { registerCalendar } from '@vonage/vivid-api' ;
registerCalendar ( 'your-prefix' );
< your-prefix-calendar class= "calendar" ></ your-prefix-calendar >
Calendar Column / Header Background Color
When using sticky-mode (header, column, or both), set the CSS variable --calendar-column-background-color to define the background color of sticky elements.
If not specified, it defaults to --vvd-color-canvas.
import { VCalendar } from '@vonage/vivid-api-vue' ;
< VCalendar sticky-mode= "all" ></ VCalendar >
--calendar-header-background-color : var ( --vvd-color-neutral-100 );
--calendar-column-background-color : var ( --vvd-color-neutral-100 );
background-color : var ( --vvd-color-neutral-100 );
< vwc-calendar sticky-mode= "all" ></ vwc-calendar >
--calendar-header-background-color : var ( --vvd-color-neutral-100 );
--calendar-column-background-color : var ( --vvd-color-neutral-100 );
background-color : var ( --vvd-color-neutral-100 );
Each day in the Calendar has a slot assigned to it. Use the Calendar Event component in these slots to arrange events around the weekly view.
import { VCalendar , VCalendarEvent } from '@vonage/vivid-api-vue' ;
< VCalendar class= "calendar" >
< VCalendarEvent slot= "day-0" start= "10" duration= "1" heading= "Backlog refinement" ></ VCalendarEvent >
< VCalendarEvent slot= "day-0" start= "12" duration= "1" heading= "Gym Workout" connotation= "cta" ></ VCalendarEvent >
< VCalendarEvent slot= "day-1" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ VCalendarEvent >
< VCalendarEvent slot= "day-2" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ VCalendarEvent >
< VCalendarEvent slot= "day-2" start= "12" duration= "1" heading= "Swim" connotation= "cta" ></ VCalendarEvent >
< VCalendarEvent slot= "day-3" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ VCalendarEvent >
< VCalendarEvent slot= "day-4" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ VCalendarEvent >
< VCalendarEvent slot= "day-4" start= "14" duration= "0.75" heading= "Sprint demo" ></ VCalendarEvent >
< VCalendarEvent slot= "day-4" start= "12" duration= "1" heading= "Gym Workout" connotation= "cta" ></ VCalendarEvent >
< VCalendarEvent slot= "day-5" start= "9" duration= "1" heading= "Park run" connotation= "cta" ></ VCalendarEvent >
< vwc-calendar class= "calendar" >
< vwc-calendar-event slot= "day-0" start= "10" duration= "1" heading= "Backlog refinement" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-0" start= "12" duration= "1" heading= "Gym Workout" connotation= "cta" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-1" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-2" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-2" start= "12" duration= "1" heading= "Swim" connotation= "cta" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-3" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-4" start= "10" duration= "0.5" heading= "Daily stand up" appearance= "subtle" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-4" start= "14" duration= "0.75" heading= "Sprint demo" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-4" start= "12" duration= "1" heading= "Gym Workout" connotation= "cta" ></ vwc-calendar-event >
< vwc-calendar-event slot= "day-5" start= "9" duration= "1" heading= "Park run" connotation= "cta" ></ vwc-calendar-event >
Property Type Default Description datetime string | DateSets the week to display hour12 booleanDisplays a time in 12 hour format locales string | string[]Sets the locale to be displayed startDay 'sunday' | 'monday'Sets the first day of the week to display stickyMode 'none' | 'header' | 'column' | 'all'Set the `sticky-mode` attribute
Property Type Default Description datetime string | DateSets the week to display hour12 booleanDisplays a time in 12 hour format locales string | string[]Sets the locale to be displayed start-day 'sunday' | 'monday'Sets the first day of the week to display sticky-mode 'none' | 'header' | 'column' | 'all'Set the `sticky-mode` attribute
Name Description day-0 Assign elements to corresponding day column using this slot. day-1 Assign elements to corresponding day column using this slot. day-2 Assign elements to corresponding day column using this slot. day-3 Assign elements to corresponding day column using this slot. day-4 Assign elements to corresponding day column using this slot. day-5 Assign elements to corresponding day column using this slot. day-6 Assign elements to corresponding day column using this slot. default Default slot.
Name Description day-0 Assign elements to corresponding day column using this slot. day-1 Assign elements to corresponding day column using this slot. day-2 Assign elements to corresponding day column using this slot. day-3 Assign elements to corresponding day column using this slot. day-4 Assign elements to corresponding day column using this slot. day-5 Assign elements to corresponding day column using this slot. day-6 Assign elements to corresponding day column using this slot. default Default slot.
Property Type Default Description appearance 'filled' | 'duotone' | 'subtle'Sets the event's appearance connotation 'alert' | 'accent' | 'cta' | 'success' | 'warning' | 'information' | 'announcement'Sets the first day of the week to display description stringSets the event description duration numberSets the event duration (e.g. `2` = 2 hours) heading stringSets the event heading overlapCount numberSets the stacking context of the event when it overlaps with another start numberSets the event start time (e.g. `14` = 2pm)
Property Type Default Description appearance 'filled' | 'duotone' | 'subtle'Sets the event's appearance connotation 'alert' | 'accent' | 'cta' | 'success' | 'warning' | 'information' | 'announcement'Sets the first day of the week to display description stringSets the event description duration numberSets the event duration (e.g. `2` = 2 hours) heading stringSets the event heading overlap-count numberSets the stacking context of the event when it overlaps with another start numberSets the event start time (e.g. `14` = 2pm)