Calendar
Use the Event Calendar as a traditional month view or combine it with an agenda as a week view. The events can be rendered as labels or in a popover that is shown on day click.
Overview
The Calendar view supports everything from single to multiple week views all the way to month grids with various ways to render events.
The capabilities like recurring events, all-day, multi-day events, responsiveness are supported by the Event Calendar.

Showing the Calendar
View combination
The four views - scheduler, calendar, timeline, agenda - can be used alone or combined with each-other to create the perfect user experience on mobile, desktop and on everything in-between.
For example, you can choose to render an agenda below the calendar broken up into days ordered chronologically. The view option will look like the following:
function App() {
const myViewOptions = {
calendar: {
type: 'week'
},
agenda: {
type: 'day'
}
};
return <Eventcalendar view={myViewOptions} />
}
Configuring the view
The Calendar view can be configured through the view option. Below are listed the calendar object properties which can help you fine-tune this view.
function App() {
const myViewOptions = {
calendar: {
labels: true,
type: 'week',
size: 2
}
};
return <Eventcalendar view={myViewOptions} />
}
count
boolean
If true, it will display the number of events on the days with events.
Default value: false
eventDisplay
"fill" | "exact"
Specifies how events are displayed.
- If set to
'exact', events are displayed according to their start and end times. - If set to
'fill', events cover the entire day.
Default value: 'fill'
labels
number | boolean | "all"
Enable displaying events as labels on calendar days.
- If set to
true, events will be displayed in the available space. If there are more events for a day, than the available space, a label with "more" text will be displayed, which opens a popover showing all the events for the given day. To fit more events on a day, set the calendar height to an appropriate value, using the height option. - If set to
'all', all the events will be displayed in the calendar cell and the row height will auto-expand based on the displayed events. The view will become scrollable if the rows overflow the available height. - Specify a number to set how many events will be displayed before the "more" button in a calendar cell. The row height will auto expand until the labels count reaches the given number and after that the "x more" button will be displayed. In the case when only one event should go in the "more" popup, that event will be displayed in the place of the "x more" button.
Default value: true
outerDays
boolean
Show or hide days from previous and next months. Hiding only works for type: 'month'.
Default value: false
popover
boolean
Enable popover on days containing events. If not explicitly defined, the popover will not show up if an agenda view is also displayed. If event labels are displayed, the popover will only show up for days where the labels do not fit on the calendar, and a "more" label is present.
Default value: undefined
popoverClass
string
A CSS class that's added to the popover element. Can be used to customize the styling of the popover on a calendar basis.
scroll
"horizontal" | "vertical"
Specifies the direction of the calendar scroll. Can be 'horizontal' or 'vertical'
Default value: 'horizontal'
size
number
Specifies the number of displayed weeks/months.
Default value: 1
type
"month" | "year" | "week"
Specifies the calendar type
Default value: 'month'
weekNumbers
boolean
Show or hide week numbers.
Default value: false
Responsiveness
The Event Calendar is fully responsive. It adapts to the available space and fills the screen to look good everywhere. While you don't have to worry about the width the height can be manually adjusted with the height option. This specifies different options for different container widths, in a form of an object, where the keys are the name of the breakpoints, and the values are objects containing the options for the given breakpoint.
Use the responsive option to configure how the calendar behaves on different sized screens. The responsive option is equipped with five breakpoints:
xsmall(up to 575px),small(up to 767px),medium(up to 991px),large(up to 1199px),xlarge(from 1200px).
Also, custom breakpoints can be added if necessary:
my-custom-breakpoint: { breakpoint: 600 }(from 600px up to the next breakpoint).
The available width is queried from the container element of the component and not the browsers viewport like in css media queries.
function App() {
const myResponsive = {
xsmall: {
calendar: { type: 'week' },
agenda: { type: 'day' }
},
custom: { // Custom breakpoint, you can use multiple if needed, but each must have a unique name.
breakpoint: 600,
view: { calendar: { labels: true }}
}
};
return <Eventcalendar responsive={myResponsive} />
}

Templating
The display of Calendar can be customized with different render functions.
The event label and their content
There are two approaches you can take:
- Customize the label contents, that appears on the calendar - for this you will want to use the renderLabelContent option. The Event Calendar will take care of styling and you can focus on what you show inside of the label.
- Customize the labels that appear on the calendar view - use the renderLabel option. The Event Calendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you.
Check out how you can style labels and their content in this example or just play with the slider below to see the differences.


The event in popover and their content
The events can be customized in two ways:
- Customize the event content that appears on the popover - by using the renderEventContent option. The Event Calendar will take care of styling and you can focus on what you show inside of the event.
- Customize the events that appear on the popover - with the renderEvent option. It should return the markup of the event. The Event Calendar will take care of the positioning, but everything else (like background color, hover effect, etc.) is left to you.
Check out how you can style events and their content in this example or just play with the slider below to see the differences.


The event calendar header
Customize how the header of the Event Calendar looks and how the components are arranged with the renderHeader option. It takes a function that should return the desired markup. In the returned markup, you can use custom html as well as the built in header components of the calendar.
While fully customizing the header is very usefull, sometimes it's desireable to customize only parts of it. In this case you can take advantage of the default header's building blocks. These components let you put toghether the header you want, while you don't have to worry about the functionality behind them.
Check out how you can style the header in this example or just play with the slider below to see the differences.


Event order
The rendered event order is determined by the following two concepts:
- Event data order
- Event layout
The combination of these concepts results in the final rendered event order.
Event data order
The sequence in which events are processed before being passed to the layout algorithm. The default ordering rules are as follows:
- All-day events are placed at the top.
- Non-all-day events follow, sorted by their start times.
- Events with the same start time are further ordered alphabetically by their titles.
This default order can be modified using the order property in the event event data. The order property takes precedence over the default rules. If two events have the same order value, the default rules apply. For more complex ordering requirements, the eventOrder option can be used. This option accepts a function that compares two events and returns an order (-1 or 1).
Event layout
The event layout process determines the visual positioning and dimensions of events. This is a built-in functionality and cannot be altered externally. The layout algorithm processes the sorted event list and calculates each event's position and size. The algorithm follows these steps:
- The first event is placed in the first position of the event track.
- If two or more events overlap in their start/end times, the later event is placed in the next event track, positioned below to the previous event.
- If a subsequent event does not overlap with any already added events, it is placed back in the first event track.
- This process continues until all events are positioned within their respective rows.
API
Here is a comprehensive list of all the specific options, events and methods of the Event Calendar view.
Options
Explore the following API options that help you easily configure the Event Calendar.
actionableEvents
boolean
Specifies if the events on the agenda and inside the calendar popover are actionable or not.
If actionable, the event items will have hover and active states, and pointer cursor.
Set to false when custom event rendering is used and the event list items contain other actionable elements, e.g. buttons.
Default value: true
clickToCreate
boolean | "double" | "single"
Enable new event creation on click. If true or 'double', a new event will be created only with a double click
and with the 'single' value the event will be created instantly with a single click.
This option will only work on desktop environment where mouse events are fired. It will also allow deleting of the focused events using the Delete or Backspace key.
In touch environment a long tap should be used to create a new event and it is controlled by the dragToCreate option.
Using the extendDefaultEvent option extra properties can be set for the created event.
The event deletion functionality can be overwritten using the eventDelete option.
Default value: undefined
colors
Array<MbscCalendarColor>
Specifies the color for certain dates or date ranges on the calendar.
The MbscCalendarColor type has the following properties:
allDay: boolean - Specifies whether the date you want to color is all day or not.background: string - Background color of the cell. It can be any valid CSS color ('red','#ff0000','rgb(255, 0, 0)', etc.).cellCssClass: string - CSS class for the day cell. Only applicable for the calendar view.cssClass: string - Specifies a custom CSS class for the color. Useful when customization is needed for the background of cells and time ranges. Only applicable for the timeline and scheduler views.date: string | object | Date - Specifies a single date for the colorend: string | object | Date - Specifies the end date/time of a date/time range for the colorhighlight: string - Highlight color of the day, can be any valid CSS color ('red','#ff0000','rgb(255, 0, 0)', etc.).recurring: string | MbscRecurrenceRule - Specifies a recurrence rule for handling recurring days.recurringException: string | object | Date | Array<string | object | Date> - Exception dates of the recurring rule. Useful when specific dates need to be skipped from the rule.recurringExceptionRule: string | MbscRecurrenceRule - Exception rule of the recurring rule. Useful when recurring dates need to be skipped from the rule.resource: string | number | Array<string | number> - In case of the timeline and scheduler view of the Eventcalendar, specifies the resource ids for the color. The color will be displayed only on the specified resource. If there is no resource defined, it will be applied to every resource.slot: string | number - In case of the timeline view of the Eventcalendar, specifies the slot id for the color. The color will be displayed only on the specified slot. If there is no slot defined, it will be applied to every slot.start: string | object | Date - Specifies the start date/time of a date/time range for the colortextColor: string - A color applied on the text.title: string - A title that will be displayed on the item.
The colored range will be considered all-day if:
- the
allDayproperty is explicitly set. - the
start/endproperties are not specified, only thedate.
The dates can be specified as JavaScript Date objects, ISO 8601 strings, or moment objects.
For Javascript Date objects the month numbers are zero based. Like: 0 - January, 1 - February ... 11 - December.
[
{ date: new Date(2020, 2, 23), background: 'pink' },
{ date: new Date(2020, 2, 24), background: 'green' },
{ background: '#ff0000', recurring: { repeat: 'weekly', weekDays: 'SU' } },
{ background: 'yellow', recurring: { repeat: 'weekly', weekDays: 'SA' } }
]
Default value: undefined