Showcase

Calendar

This documentation provides a comprehensive reference for the Calendar component, guiding you through its configuration options.
Demos

Screenshot #

Blazor Calendar Component

Calendar Parameters #

Name Type Default Required Description Added Version
AdditionalAttributes Dictionary<string, object>? null Gets or sets additional attributes that will be applied to the component. 4.1.0
AgendaDays int 7 Gets or sets the number of days the Agenda view lists. 4.1.0
AgendaText string Agenda Gets or sets the text of the Agenda view button. 4.1.0
AllDayField Func<object?, bool>? null Gets or sets a function that tells whether an event is an all-day event. 4.1.0
AllDayText string All day Gets or sets the label of the all-day row in the Week, Work week, and Day views. 4.1.0
AllowEventMove bool True Gets or sets whether the user can move an event by dragging it. The calendar reports the new times through OnEventMoved; the event moves only when the app updates its list. 4.1.0
AllowEventResize bool True Gets or sets whether the user can resize an event by dragging one of its ends. The calendar reports the new times through OnEventResized; the event changes only when the app updates its list. 4.1.0
AllowRangeSelection bool True Gets or sets whether the user can select a range of days or time slots by dragging. The calendar reports the range through OnRangeSelected. 4.1.0
AriaLabel string? null Gets or sets the accessible name of the calendar, read by screen readers. 4.1.0
Class string? null Gets or sets the CSS class name(s) to apply to the component. 4.1.0
CloseText string Close Gets or sets the accessible name of the button that closes a day's full event list. 4.1.0
ColorField Func<object?, CalendarColor>? null Gets or sets a function that returns the color of an event. 4.1.0
CompactBreakpoint CalendarCompactBreakpoint Medium Gets or sets the width below which the calendar shows its compact layout. 4.1.0
Culture CultureInfo? null Gets or sets the culture that supplies month and day names, date and time formats, the first day of the week, and the calendar system. When null, the current culture is used. 4.1.0
Data IEnumerable<object?>? null Gets or sets the events. 4.1.0
Date DateOnly null Gets or sets the date the calendar shows: the visible period is the one that contains it. Default value is today. 4.1.0
DayEnd TimeOnly null Gets or sets the time the hourly grid of the Week, Work week, and Day views ends at. A value that is not after DayStart means the end of the day. Default value is 00:00, the end of the day. 4.1.0
DayMarkProvider Func<DateOnly, CalendarDayMark?>? null Gets or sets a function that marks a day: a label, a highlight color, and non-working shading. It is called for each day the calendar shows; return null for a day with no mark. 4.1.0
DayStart TimeOnly null Gets or sets the time the hourly grid of the Week, Work week, and Day views starts at. Default value is 00:00. 4.1.0
DayText string Day Gets or sets the text of the Day view button. 4.1.0
EmptyText string No events Gets or sets the text shown where there are no events: in the Agenda view for a period without events, and in the compact Month view for a selected day without events. 4.1.0
EndField Func<object?, DateTime>? null Gets or sets a function that returns the end of an event. An end at midnight is exclusive: an event from 1 November 00:00 to 3 November 00:00 covers 1 and 2 November. 4.1.0
EventTemplate RenderFragment<CalendarEventContext<object?>>? null Gets or sets a template that replaces the content of every event. Its context carries the event's item, title, start, end, and the view it is drawn in. 4.1.0
FirstDayOfWeek DayOfWeek? null Gets or sets the first day of the week. It overrides the culture's first day without changing the culture. When null, the culture's first day is used. 4.1.0
Height double 600 Gets or sets the height in pixels of the hourly grid of the Week, Work week, and Day views. The grid scrolls inside it. A value of 0 or less shows the whole grid. 4.1.0
HiddenDays IReadOnlyList<DayOfWeek>? null Gets or sets the weekdays the calendar does not show, for example Saturday and Sunday. An event on a hidden day is not drawn; an event that covers several days keeps its part on the days that are shown. 4.1.0
Holidays IReadOnlyList<CalendarHoliday>? null Gets or sets the holidays. The calendar labels each with its name and shades it as a non-working day in every view. 4.1.0
Id string? null Gets or sets the ID. If not set, a unique ID will be generated. 4.1.0
MonthText string Month Gets or sets the text of the Month view button. 4.1.0
MoreTextFormat string +{0} more Gets or sets the format of the text shown on a Month day with more events than fit. {0} is the number of hidden events. 4.1.0
NextText string Next Gets or sets the accessible name of the next button. 4.1.0
PreviousText string Previous Gets or sets the accessible name of the previous button. 4.1.0
SelectedDate DateOnly? null Gets or sets the selected day. Clicking a day selects it. 4.1.0
ShowWeekNumbers bool False Gets or sets whether the calendar shows week numbers: beside each week in the Month view, and in the corner of the Week, Work week, and Day views. 4.1.0
SlotMinutes int 30 Gets or sets the length of a time slot in the Week, Work week, and Day views: 15, 30, or 60 minutes. Any other value means 30. 4.1.0
StartField Func<object?, DateTime>? null Gets or sets a function that returns the start of an event. 4.1.0
Style string? null Gets or sets the CSS style string that defines the inline styles for the component. 4.1.0
TimeFormat CalendarTimeFormat Culture Gets or sets how times of day are shown: in the culture's format, on a 12-hour clock, or on a 24-hour clock. It overrides the culture's time format without changing the culture. 4.1.0
TitleField Func<object?, string?>? null Gets or sets a function that returns the title of an event. 4.1.0
TodayText string Today Gets or sets the text of the Today button. 4.1.0
View CalendarView Month Gets or sets the view the calendar shows. 4.1.0
ViewText string View Gets or sets the accessible name of the view switch. 4.1.0
WeekNumberRule CalendarWeekNumberRule Culture Gets or sets how weeks are numbered: by the culture's rule, or by ISO 8601. 4.1.0
WeekNumberText string Wk Gets or sets the short text that heads the week numbers. 4.1.0
WeekText string Week Gets or sets the text of the Week view button. 4.1.0
WorkDayEnd TimeOnly null Gets or sets the time the working day ends at. Time after it is shaded in the Week, Work week, and Day views. Default value is 17:00. 4.1.0
WorkDays IReadOnlyList<DayOfWeek>? null Gets or sets the working days the Work week view shows. When null, Monday to Friday. 4.1.0
WorkDayStart TimeOnly null Gets or sets the time the working day starts at. Time before it is shaded in the Week, Work week, and Day views, and the hourly grid opens there when today is not shown. Default value is 09:00. 4.1.0
WorkWeekText string Work week Gets or sets the text of the Work week view button. 4.1.0

Calendar Events #

Name Return Type Description Added Version
DateChanged EventCallback<DateOnly> This event fires when navigation changes the date the calendar shows. 4.1.0
OnDayClick EventCallback<CalendarDayClickEventArgs> This event fires when the user clicks a day. 4.1.0
OnEventClick EventCallback<CalendarEventClickEventArgs<object?>> This event fires when the user clicks an event. Open your own form here; the calendar shows none. 4.1.0
OnEventMoved EventCallback<CalendarEventChangedEventArgs<object?>> This event fires when the user moved an event by dragging it. It carries the event and its new start and end. Update your list to apply the move; if you do not, the event stays where it was. 4.1.0
OnEventResized EventCallback<CalendarEventChangedEventArgs<object?>> This event fires when the user resized an event by dragging one of its ends. It carries the event and its new start and end. Update your list to apply the change; if you do not, the event stays as it was. 4.1.0
OnRangeSelected EventCallback<CalendarRangeSelectedEventArgs> This event fires when the user selected a range of days or time slots by dragging. Open your own form here to create an event in the range. 4.1.0
OnSlotClick EventCallback<CalendarSlotClickEventArgs> This event fires when the user clicks an empty time slot in the Week, Work week, or Day view. 4.1.0
OnVisibleRangeChanged EventCallback<CalendarVisibleRangeChangedEventArgs> This event fires after the first render and whenever navigation or a view switch changes the dates the calendar shows. Use it to load the events of the visible range. 4.1.0
SelectedDateChanged EventCallback<DateOnly?> This event fires when the user selects a day. 4.1.0
ViewChanged EventCallback<CalendarView> This event fires when the user switches the view. 4.1.0

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.