Skip to contentSkip to content

EventTimelinePremium API

API reference docs for the React EventTimelinePremium component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import { EventTimelinePremium } from '@mui/x-scheduler-premium/event-timeline-premium';
// or
import { EventTimelinePremium } from '@mui/x-scheduler-premium';

Learn about the difference by reading this guide on minimizing bundle size.

Props

Props of the native component are also available.

NameTypeDefaultDescription
apiRef{ current?: { goToNextVisibleDate?: func, goToPreviousVisibleDate?: func, setVisibleDate?: func } }-

The ref object that allows Event Timeline manipulation. Can be instantiated with useEventTimelinePremiumApiRef().

areEventsDraggablebooltrue

Whether the event can be dragged to change its start and end dates without changing the duration.

areEventsResizable'end'
| 'start'
| bool
true

Whether the event start or end can be dragged to change its duration without changing its other date. If true, both start and end can be resized. If false, the events are not resizable. If "start", only the start can be resized. If "end", only the end can be resized.

canDragEventsFromTheOutsideboolfalse

Whether events can be dragged from outside of the calendar and dropped into it.

canDropEventsToTheOutsideboolfalse

Whether events can be dragged from inside of the calendar and dropped outside of it. If true, when the mouse leaves the calendar, the event won't be rendered inside the calendar anymore. If false, when the mouse leaves the calendar, the event will be rendered in its last valid position inside the calendar.

classesobject-

Override or extend the styles applied to the component.

See CSS classes API below for more details.

dataSource{ getEvents: func, updateEvents: func }-

Data source for fetching events asynchronously. When provided, events are fetched through the data source instead of the events prop.

dateLocaleobjectenUS (English)

The locale object from date-fns used to format dates. This affects day names, month names, week start day, and other locale-dependent formatting. Import a locale from date-fns/locale and pass it to this prop.

defaultPreferences{ ampm?: bool }{ ampm: true }

The default preferences for the timeline. To use controlled preferences, use the preferences prop.

defaultView'days'
| 'months'
| 'time'
| 'weeks'
| 'years'
"time"

The view initially displayed in the timeline. To render a controlled timeline, use the view prop.

defaultVisibleDateDatetoday

The date initially used to determine the visible date range in each view. To render a controlled calendar, use the visibleDate prop.

defaultVisibleResourcesobject{} - all resources are visible

The IDs of the resources initially visible. To render a controlled scheduler, use the visibleResources prop.

displayTimezonestring"default"

The timezone used to display events in the scheduler.
Accepts any valid IANA timezone name (for example "America/New_York", "Europe/Paris", "Asia/Tokyo"), or keywords understood by the adapter, such as "default" (use the adapter's default timezone), "locale" (use the user's current locale timezone), or "UTC".
This timezone only affects rendering, events keep their original data timezone.

eventColor'amber'
| 'blue'
| 'green'
| 'grey'
| 'indigo'
| 'lime'
| 'orange'
| 'pink'
| 'purple'
| 'red'
| 'teal'
"teal"

The color palette used for all events. Can be overridden per resource using the eventColor property on the resource model. Can be overridden per event using the color property on the event model.

eventModelStructureobject-

The structure of the event model. It defines how to read and write the properties of the event model. If not provided, the event model is assumed to match the CalendarEvent interface.

eventsArray<object>[]

The events currently available in the calendar.

localeTextobject-

Set the locale text of the Event Timeline. You can find all the translation keys supported in the source in the GitHub repository.

onEventsChangefunc-

Callback fired when some event of the calendar change.

onPreferencesChangefunc-

Event handler called when the preferences change.

onViewChangefunc-

Event handler called when the view changes.

onVisibleDateChangefunc-

Event handler called when the visible date changes.

onVisibleResourcesChangefunc-

Event handler called when the visible resources change.

preferences{ ampm?: bool }-

Preferences currently displayed in the timeline.

readOnlyboolfalse

Whether the calendar is in read-only mode.

resourceColumnLabelstring-

The label displayed in the resource column header. When provided, this takes priority over localeText.timelineResourceTitleHeader.

resourceModelStructureobject-

The structure of the resource model. It defines how to read and write the properties of the resource model. If not provided, the resource model is assumed to match the CalendarResource interface.

resourcesArray<object>-

The resources the events can be assigned to.

showCurrentTimeIndicatorbooltrue

Whether the component should display the current time indicator.

sxArray<func
| object
| bool>
| func
| object
-

The system prop that allows defining system overrides as well as additional CSS styles.

See the `sx` page for more details.

view'days'
| 'months'
| 'time'
| 'weeks'
| 'years'
-

The view currently displayed in the timeline.

viewsArray<'days'
| 'months'
| 'time'
| 'weeks'
| 'years'>
["time", "days", "weeks", "months", "years"]

The views available in the timeline.

visibleDateDate-

The date currently used to determine the visible date range in each view.

visibleResourcesobject-

The IDs of the resources currently visible. A resource is visible if it is not included in this object or if it is included with true value.

The ref is forwarded to the root element.

Theme default props

You can use MuiEventTimelinePremium to change the default props of this component with the theme.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

Class nameRule nameDescription
.MuiEventTimelinePremium-contentcontentStyles applied to the content section element.
.MuiEventTimelinePremium-currentTimeIndicatorcurrentTimeIndicatorStyles applied to the current time indicator element.
.MuiEventTimelinePremium-currentTimeIndicatorCirclecurrentTimeIndicatorCircleStyles applied to the current time indicator circle element.
.MuiEventTimelinePremium-daysHeaderdaysHeaderStyles applied to the days header root element.
.MuiEventTimelinePremium-daysHeaderCelldaysHeaderCellStyles applied to days header cell elements.
.MuiEventTimelinePremium-daysHeaderDayNumberdaysHeaderDayNumberStyles applied to days header day number elements.
.MuiEventTimelinePremium-daysHeaderMonthStartdaysHeaderMonthStartStyles applied to days header month start elements.
.MuiEventTimelinePremium-daysHeaderMonthStartLabeldaysHeaderMonthStartLabelStyles applied to days header month start label elements.
.MuiEventTimelinePremium-daysHeaderTimedaysHeaderTimeStyles applied to days header time elements.
.MuiEventTimelinePremium-daysHeaderWeekDaydaysHeaderWeekDayStyles applied to days header week day elements.
.MuiEventTimelinePremium-eventeventStyles applied to event elements.
.MuiEventTimelinePremium-eventDialogeventDialogStyles applied to the event dialog root element.
.MuiEventTimelinePremium-eventDialogActionseventDialogActionsStyles applied to the event dialog actions element.
.MuiEventTimelinePremium-eventDialogCloseActioneventDialogCloseActionStyles applied to the event dialog close action button element.
.MuiEventTimelinePremium-eventDialogCloseButtoneventDialogCloseButtonStyles applied to the event dialog close button element.
.MuiEventTimelinePremium-eventDialogContenteventDialogContentStyles applied to the event dialog content element.
.MuiEventTimelinePremium-eventDialogDateTimeContainereventDialogDateTimeContainerStyles applied to the event dialog date time container element.
.MuiEventTimelinePremium-eventDialogDateTimeFieldsContainereventDialogDateTimeFieldsContainerStyles applied to the event dialog date time fields container element.
.MuiEventTimelinePremium-eventDialogDateTimeFieldsRoweventDialogDateTimeFieldsRowStyles applied to the event dialog date time fields row element.
.MuiEventTimelinePremium-eventDialogDateTimeIconeventDialogDateTimeIconStyles applied to the event dialog date time icon element.
.MuiEventTimelinePremium-eventDialogDateTimeLabeleventDialogDateTimeLabelStyles applied to the event dialog date time label element.
.MuiEventTimelinePremium-eventDialogDeleteButtoneventDialogDeleteButtonStyles applied to the event dialog delete button element.
.MuiEventTimelinePremium-eventDialogDescriptionLabeleventDialogDescriptionLabelStyles applied to the event dialog description label element.
.MuiEventTimelinePremium-eventDialogEndsRadioGroupeventDialogEndsRadioGroupStyles applied to the event dialog ends radio group element.
.MuiEventTimelinePremium-eventDialogFormeventDialogFormStyles applied to the event dialog form element.
.MuiEventTimelinePremium-eventDialogFormActionseventDialogFormActionsStyles applied to the event dialog form actions element.
.MuiEventTimelinePremium-eventDialogFormDividereventDialogFormDividerStyles applied to the event dialog form divider element.
.MuiEventTimelinePremium-eventDialogFrequencySelecteventDialogFrequencySelectStyles applied to the event dialog frequency select element.
.MuiEventTimelinePremium-eventDialogHeadereventDialogHeaderStyles applied to the event dialog header element.
.MuiEventTimelinePremium-eventDialogInlineRoweventDialogInlineRowStyles applied to the event dialog inline row element.
.MuiEventTimelinePremium-eventDialogPapereventDialogPaperStyles applied to the event dialog paper element.
.MuiEventTimelinePremium-eventDialogRadioButtonLabeleventDialogRadioButtonLabelStyles applied to the event dialog radio button label element.
.MuiEventTimelinePremium-eventDialogReadonlyContenteventDialogReadonlyContentStyles applied to the event dialog readonly content element.
.MuiEventTimelinePremium-eventDialogRecurrenceIconeventDialogRecurrenceIconStyles applied to the event dialog recurrence icon element.
.MuiEventTimelinePremium-eventDialogRecurrenceLabeleventDialogRecurrenceLabelStyles applied to the event dialog recurrence label element.
.MuiEventTimelinePremium-eventDialogRecurrenceLabelContainereventDialogRecurrenceLabelContainerStyles applied to the event dialog recurrence label container element in the readonly content.
.MuiEventTimelinePremium-eventDialogRecurrenceSelectorContainereventDialogRecurrenceSelectorContainerStyles applied to the event dialog recurrence selector container element.
.MuiEventTimelinePremium-eventDialogRecurrenceSelectorToggleGroupeventDialogRecurrenceSelectorToggleGroupStyles applied to the event dialog recurrence selector toggle group element.
.MuiEventTimelinePremium-eventDialogRepeatSectionContenteventDialogRepeatSectionContentStyles applied to the event dialog repeat section content element.
.MuiEventTimelinePremium-eventDialogRepeatSectionFieldseteventDialogRepeatSectionFieldsetStyles applied to the event dialog repeat section fieldset element.
.MuiEventTimelinePremium-eventDialogRepeatSectionLabeleventDialogRepeatSectionLabelStyles applied to the event dialog repeat section label element.
.MuiEventTimelinePremium-eventDialogResourceContainereventDialogResourceContainerStyles applied to the event dialog resource container element.
.MuiEventTimelinePremium-eventDialogResourceLegendColoreventDialogResourceLegendColorStyles applied to the event dialog resource legend color element.
.MuiEventTimelinePremium-eventDialogResourceLegendContainereventDialogResourceLegendContainerStyles applied to the event dialog resource legend container element.
.MuiEventTimelinePremium-eventDialogResourceMenuColorDoteventDialogResourceMenuColorDotStyles applied to the event dialog resource menu color dot element.
.MuiEventTimelinePremium-eventDialogResourceMenuColorRadioButtoneventDialogResourceMenuColorRadioButtonStyles applied to the event dialog resource menu color radio button element.
.MuiEventTimelinePremium-eventDialogResourceMenuItemeventDialogResourceMenuItemStyles applied to the event dialog resource menu item element.
.MuiEventTimelinePremium-eventDialogResourceMenuListSubheadereventDialogResourceMenuListSubheaderStyles applied to the event dialog resource menu list subheader element.
.MuiEventTimelinePremium-eventDialogResourceTitleeventDialogResourceTitleStyles applied to the event dialog resource title element.
.MuiEventTimelinePremium-eventDialogSaveButtoneventDialogSaveButtonStyles applied to the event dialog save button element.
.MuiEventTimelinePremium-eventDialogSectionHeaderTitleeventDialogSectionHeaderTitleStyles applied to the event dialog section header title element.
.MuiEventTimelinePremium-eventDialogSmallNumberFieldeventDialogSmallNumberFieldStyles applied to the event dialog small number field element.
.MuiEventTimelinePremium-eventDialogTabeventDialogTabStyles applied to the event dialog tab elements.
.MuiEventTimelinePremium-eventDialogTabContenteventDialogTabContentStyles applied to the event dialog tab content element.
.MuiEventTimelinePremium-eventDialogTabPaneleventDialogTabPanelStyles applied to the event dialog tab panel element.
.MuiEventTimelinePremium-eventDialogTabsContainereventDialogTabsContainerStyles applied to the event dialog tabs container element.
.MuiEventTimelinePremium-eventDialogTitleeventDialogTitleStyles applied to the event dialog title element.
.MuiEventTimelinePremium-eventDialogWeekDaySelectorCheckboxeventDialogWeekDaySelectorCheckboxStyles applied to the event dialog week day selector form group element.
.MuiEventTimelinePremium-eventLinesClampeventLinesClampStyles applied to event lines clamp elements.
.MuiEventTimelinePremium-eventPlaceholdereventPlaceholderStyles applied to event placeholder elements.
.MuiEventTimelinePremium-eventResizeHandlereventResizeHandlerStyles applied to event resize handler elements.
.MuiEventTimelinePremium-eventsHeaderCelleventsHeaderCellStyles applied to the events header cell element.
.MuiEventTimelinePremium-eventsHeaderCellContenteventsHeaderCellContentStyles applied to the events header cell content element.
.MuiEventTimelinePremium-eventsSubGrideventsSubGridStyles applied to the events sub-grid element.
.MuiEventTimelinePremium-eventsSubGridRoweventsSubGridRowStyles applied to the events sub-grid row element.
.MuiEventTimelinePremium-eventsSubGridWrappereventsSubGridWrapperStyles applied to the events sub-grid wrapper element.
.MuiEventTimelinePremium-gridgridStyles applied to the grid element.
.MuiEventTimelinePremium-headerRowheaderRowStyles applied to the header row element.
.MuiEventTimelinePremium-monthsHeadermonthsHeaderStyles applied to the months header root element.
.MuiEventTimelinePremium-monthsHeaderMonthLabelmonthsHeaderMonthLabelStyles applied to months header month label elements.
.MuiEventTimelinePremium-monthsHeaderYearLabelmonthsHeaderYearLabelStyles applied to months header year label elements.
.MuiEventTimelinePremium-rootrootStyles applied to the root element.
.MuiEventTimelinePremium-timeHeadertimeHeaderStyles applied to the time header root element.
.MuiEventTimelinePremium-timeHeaderCelltimeHeaderCellStyles applied to time header cell elements.
.MuiEventTimelinePremium-timeHeaderCellsRowtimeHeaderCellsRowStyles applied to the time header cells row element.
.MuiEventTimelinePremium-timeHeaderDayLabeltimeHeaderDayLabelStyles applied to the time header day label element.
.MuiEventTimelinePremium-timeHeaderTimeCelltimeHeaderTimeCellStyles applied to time header time cell elements.
.MuiEventTimelinePremium-timeHeaderTimeLabeltimeHeaderTimeLabelStyles applied to time header time label elements.
.MuiEventTimelinePremium-titleCelltitleCellStyles applied to the title cell element.
.MuiEventTimelinePremium-titleCellLegendColortitleCellLegendColorStyles applied to the title cell legend color element.
.MuiEventTimelinePremium-titleCellRowtitleCellRowStyles applied to the title cell row element.
.MuiEventTimelinePremium-titleHeaderCelltitleHeaderCellStyles applied to the title header cell element.
.MuiEventTimelinePremium-titleSubGridtitleSubGridStyles applied to the title sub-grid element.
.MuiEventTimelinePremium-weeksHeaderweeksHeaderStyles applied to the weeks header root element.
.MuiEventTimelinePremium-weeksHeaderCellweeksHeaderCellStyles applied to weeks header cell elements.
.MuiEventTimelinePremium-weeksHeaderDayCellweeksHeaderDayCellStyles applied to weeks header day cell elements.
.MuiEventTimelinePremium-weeksHeaderDayLabelweeksHeaderDayLabelStyles applied to weeks header day label elements.
.MuiEventTimelinePremium-weeksHeaderDaysRowweeksHeaderDaysRowStyles applied to the weeks header days row element.
.MuiEventTimelinePremium-yearsHeaderyearsHeaderStyles applied to the years header root element.
.MuiEventTimelinePremium-yearsHeaderYearLabelyearsHeaderYearLabelStyles applied to years header year label elements.

You can override the style of the component using one of these customization options:

Source code

If you did not find the information in this page, consider having a look at the implementation of the component for more detail.