Custom Cell Content
Usage
theme="ios" You can turn auto theming on and let it decide based on the platform.
Usage
themeVariant="light" You can turn auto dark mode on based on system settings.
Usage
clickToCreate={true}
// click to create is on dragToCreate={true}
// drag to create is on dragToMove={true}
// reordering is on dragToResize={true}
// resizing is on eventDelete={true}
// deleting is on Fine-tune drag & drop with these options, which are false by default.
Usage
locale={localeEn} Selecting the locale loads the localized settings and the translated UI text.
Custom Cell Content
Dynamically customize the cell content of the timeline by showing event-related icons, visual indicators, and a quick add button directly in each cell.
This is achieved using the renderCell function, where event data in each cell is used to display icons based on the event, a badge showing total event hours, and a button to quickly add new events. The add event icon is dynamically added during onCellHoverIn. An event cap per cell is implemented by reading the event count from onCellHoverIn args and enforcing it in onEventCreate, blocking event creation by returning false. This approach helps visualize workload per day and enables quick actions, making scheduling more efficient and user-friendly.
In this demo, cells represent a day. Depending on the resolution, they can also stand for a week, month, or more, while remaining fully customizable. See this configuration demo to try out different timeline resolution settings.
Demo

Code
View code on GitHub
import { Eventcalendar, setOptions, Toast } from '@mobiscroll/react';
import { useCallback, useMemo, useState } from 'react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
function App() {
const [isToastOpen, setToastOpen] = useState(false);
const [toastMessage, setToastMessage] = useState();
const [myEvents, setEvents] = useState(() => [
{
id: 1,
resource: 1,
title: 'Review',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 2,
resource: 1,
title: 'Demo',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 3,
resource: 1,
title: 'Kickoff',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 4,
resource: 4,
title: 'Strategy',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 5,
resource: 4,
title: 'Collab',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
// Showing partial data. Download full source.
]);
const iconMap = useMemo(
() => ({
Review: 'calendar',
Demo: 'play',
Kickoff: 'flag',
Strategy: 'map',
Collab: 'bubbles',
Update: 'upload',
Discussion: 'bubble',
Planning: 'pencil',
Retrospect: 'history',
Onboard: 'user4',
}),
[],
);
const titles = useMemo(() => Object.keys(iconMap), [iconMap]);
const myResources = useMemo(
() => [
{ id: 1, name: 'Resource A' },
{ id: 2, name: 'Resource B' },
{ id: 3, name: 'Resource C' },
{ id: 4, name: 'Resource D' },
],
[],
);
const myView = useMemo(
() => ({
timeline: {
endDay: 5,
eventDisplay: 'fill',
type: 'month',
resolutionHorizontal: 'day',
startDay: 1,
},
}),
[],
);
const customDefaultEvent = useCallback(
(args) => ({
title: titles[Math.floor(Math.random() * titles.length)],
end: new Date(args.start.getTime() + 2 * 3600000),
}),
[titles],
);
const handleAddClick = useCallback(
(cell) => {
if (cell.events.length >= 4) {
setToastOpen(true);
setToastMessage('Task limit reached');
return;
}
setEvents((prevEvents) => [
...prevEvents,
{
start: cell.date,
end: new Date(cell.date.getTime() + 2 * 3600000),
resource: cell.resource.id,
title: titles[Math.floor(Math.random() * titles.length)],
},
]);
},
[titles],
);
const renderCell = useCallback(
(cell) => {
const events = cell.events || [];
const hours = Math.round(events.reduce((s, ev) => s + (new Date(ev.end) - new Date(ev.start)) / 36e5, 0));
const classMap = { 2: 'light', 4: 'medium', 6: 'semi', 8: 'full' };
const colorClass = 'mds-timeline-cell-content-badge-' + (classMap[hours] || 'default');
const addedIcons = new Set();
const iconHtml = events.map((ev) => {
const iconName = iconMap[ev.title];
if (iconName && !addedIcons.has(ev.title)) {
addedIcons.add(ev.title);
return <i key={ev.title} className={'mbsc-font-icon mbsc-icon-' + iconName + ' mds-timeline-cell-icon'} title={ev.title}></i>;
}
return null;
});
return (
<>
<div className={'mds-timeline-cell-content-badge ' + colorClass}>{hours}h / 8h</div>
<button onClick={() => handleAddClick(cell)} className="mds-timeline-cell-content-add">
+
</button>
<div className="mds-timeline-cell-icons">{iconHtml}</div>
</>
);
},
[handleAddClick, iconMap],
);
const renderTimelineEventContent = useCallback((event) => {
const hours = Math.round((event.endDate - event.startDate) / 36e5);
return (
<div>
{event.title} - {hours}h
</div>
);
}, []);
return (
<>
<Eventcalendar
cssClass="mds-timeline-cell-content"
clickToCreate={false}
data={myEvents}
dragToCreate={false}
dragToMove={false}
dragToResize={false}
extendDefaultEvent={customDefaultEvent}
resources={myResources}
renderCell={renderCell}
renderTimelineEventContent={renderTimelineEventContent}
view={myView}
/>
<Toast isOpen={isToastOpen} message={toastMessage} onClose={() => setToastOpen(false)} />
</>
);
}
export default App;
import {
Eventcalendar,
MbscCalendarCellData,
MbscCalendarEvent,
MbscCalendarEventData,
MbscEventcalendarView,
MbscNewEventData,
setOptions,
Toast ,
} from '@mobiscroll/react';
import { FC, useCallback, useMemo, useState } from 'react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
const App: FC = () => {
const [isToastOpen, setToastOpen] = useState<boolean>(false);
const [toastMessage, setToastMessage] = useState<string>();
const [myEvents, setEvents] = useState<MbscCalendarEvent[]>(() => [
{
id: 1,
resource: 1,
title: 'Review',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 2,
resource: 1,
title: 'Demo',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 3,
resource: 1,
title: 'Kickoff',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 4,
resource: 4,
title: 'Strategy',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
{
id: 5,
resource: 4,
title: 'Collab',
start: '2026-11-01T00:00',
end: '2026-11-01T02:00',
},
// Showing partial data. Download full source.
]);
const iconMap = useMemo(
() => ({
Review: 'calendar',
Demo: 'play',
Kickoff: 'flag',
Strategy: 'map',
Collab: 'bubbles',
Update: 'upload',
Discussion: 'bubble',
Planning: 'pencil',
Retrospect: 'history',
Onboard: 'user4',
}),
[],
);
const titles = useMemo(() => Object.keys(iconMap), [iconMap]);
const myResources = useMemo(
() => [
{ id: 1, name: 'Resource A' },
{ id: 2, name: 'Resource B' },
{ id: 3, name: 'Resource C' },
{ id: 4, name: 'Resource D' },
],
[],
);
const myView = useMemo<MbscEventcalendarView>(
() => ({
timeline: {
endDay: 5,
eventDisplay: 'fill',
type: 'month',
resolutionHorizontal: 'day',
startDay: 1,
},
}),
[],
);
const customDefaultEvent = useCallback(
(args: MbscNewEventData) => ({
title: titles[Math.floor(Math.random() * titles.length)],
end: new Date(args.start.getTime() + 2 * 3600000),
}),
[titles],
);
const handleAddClick = useCallback(
(cell: MbscCalendarCellData) => {
if (cell.events.length >= 4) {
setToastOpen(true);
setToastMessage('Task limit reached');
return;
}
setEvents((prevEvents) => [
...prevEvents,
{
start: cell.date,
end: new Date(cell.date.getTime() + 2 * 3600000),
resource: cell.resource.id,
title: titles[Math.floor(Math.random() * titles.length)],
} as MbscCalendarEvent,
]);
},
[titles],
);
const renderCell = useCallback(
(cell: MbscCalendarCellData) => {
const events = cell.events || [];
const hours = Math.round(
(cell.events || []).reduce(
(sum, ev) =>
ev.start && ev.end ? sum + (new Date(ev.end as Date).getTime() - new Date(ev.start as Date).getTime()) / 36e5 : sum,
0,
),
);
const classMap = { 2: 'light', 4: 'medium', 6: 'semi', 8: 'full' };
const colorClass = 'mds-timeline-cell-content-badge-' + (classMap[hours as keyof typeof classMap] || 'default');
const addedIcons = new Set();
const iconHtml = events.map((ev) => {
const iconName = iconMap[ev.title as keyof typeof iconMap];
if (iconName && !addedIcons.has(ev.title)) {
addedIcons.add(ev.title);
return <i key={ev.title} className={'mbsc-font-icon mbsc-icon-' + iconName + ' mds-timeline-cell-icon'} title={ev.title}></i>;
}
return null;
});
return (
<>
<div className={'mds-timeline-cell-content-badge ' + colorClass}>{hours}h / 8h</div>
<button onClick={() => handleAddClick(cell)} className="mds-timeline-cell-content-add">
+
</button>
<div className="mds-timeline-cell-icons">{iconHtml}</div>
</>
);
},
[handleAddClick, iconMap],
);
const renderTimelineEventContent = useCallback((event: MbscCalendarEventData) => {
const hours = Math.round(((event.endDate as Date).getTime() - (event.startDate as Date).getTime()) / 36e5);
return (
<div>
{event.title} - {hours}h
</div>
);
}, []);
return (
<>
<Eventcalendar
cssClass="mds-timeline-cell-content"
clickToCreate={false}
data={myEvents}
dragToCreate={false}
dragToMove={false}
dragToResize={false}
extendDefaultEvent={customDefaultEvent}
resources={myResources}
renderCell={renderCell}
renderTimelineEventContent={renderTimelineEventContent}
view={myView}
/>
<Toast isOpen={isToastOpen} message={toastMessage} onClose={() => setToastOpen(false)} />
</>
);
};
export default App;
.mds-timeline-cell-content .mbsc-timeline-day-fri::after {
content: '';
position: absolute;
top: 0;
bottom: 0;
border-right: 1px solid var(--mbsc-eventcalendar-border-color);
}
.mds-timeline-cell-content .mbsc-timeline-day-fri.mbsc-ltr::after {
left: 100%;
}
.mds-timeline-cell-content .mbsc-timeline-day-fri.mbsc-rtl::after {
right: 100%;
}
.mds-timeline-cell-content .mbsc-timeline-events {
top: 25px;
}
.mds-timeline-cell-content .mbsc-timeline-row-gutter {
height: 55px;
}
.mds-timeline-cell-content .mbsc-timeline-column {
width: 110px;
}
.mds-timeline-cell-content-badge {
position: relative;
top: 6px;
left: 4px;
display: inline-block;
padding: 1px 4px;
font-size: 13px;
font-weight: 600;
border-radius: 12px;
max-width: 80px;
color: black;
background: #f9f9f9;
overflow: hidden;
z-index: 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.mds-timeline-cell-content-badge::before {
content: '';
position: absolute;
top: 0;
left: 0;
height: 100%;
transform: skewX(-15deg);
z-index: -1;
}
.mds-timeline-cell-content-badge-light::before {
width: 25%;
background: #ff9c9c;
}
.mds-timeline-cell-content-badge-medium::before {
width: 50%;
background: #ffcf9f;
}
.mds-timeline-cell-content-badge-semi::before {
width: 75%;
background: #fff4a3;
}
.mds-timeline-cell-content-badge-full::before {
width: 100%;
background: #a3e4a1;
}
.mds-timeline-cell-content-add {
opacity: 0;
position: absolute;
top: 6px;
width: 17px;
height: 17px;
line-height: 13px;
padding: 0;
padding-bottom: 4px;
color: #fff;
border: none;
border-radius: 50%;
font-size: 22px;
cursor: pointer;
background: linear-gradient(135deg, rgb(73, 73, 73), rgb(22, 21, 21));
transition: transform 0.2s ease;
}
.mbsc-timeline-column.mbsc-ltr .mds-timeline-cell-content-add {
right: 4px;
}
.mbsc-timeline-column.mbsc-rtl .mds-timeline-cell-content-add {
left: 4px;
}
.mbsc-timeline-column:hover .mds-timeline-cell-content-add {
opacity: 1;
pointer-events: auto;
}
.mds-timeline-cell-content-add:hover {
outline: 3px solid rgba(140, 140, 140, 0.5);
}
.mds-timeline-cell-icons {
position: absolute;
inset: auto auto 4px auto;
}
.mds-timeline-cell-icon {
text-align: center;
padding: 2px 4px;
margin: 0 3px;
line-height: 17px !important;
color: #000;
background: rgba(255, 255, 255, 0.8);
border-radius: 5px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
font-size: 13px;
}