Multi-Resource Shared Events
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.
Multi-Resource Shared Events
Events can be shared among resources. This can easily be the same resource type, like people in a shared work calendar scenario or different resource types, like aircraft and instructor in a flight training scenario where you'll have to schedule an instructor and an aircraft for a class which is the event.
Shared events will render correctly in the appropriate resource columns with drag & drop, validation across invalid dates and times will work out of the box. All you need to do is to add both resourceIDs to the event.
Demo

Code
View code on GitHub
import { Eventcalendar, Input, Popup, Segmented, SegmentedGroup, setOptions } from '@mobiscroll/react';
import { useCallback, useMemo, useState } from 'react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
function App() {
const [tempEvent, setTempEvent] = useState(null);
const [title, setTitle] = useState('New event');
const [participants, setParticipants] = useState([]);
const [anchor, setAnchor] = useState(null);
const [isNewEvent, setIsNewEvent] = useState(false);
const [isOpen, setOpen] = useState(false);
const [myEvents, setEvents] = useState([
{
start: '2026-10-21T10:00',
end: '2026-10-21T15:00',
title: 'Impact Training',
resource: [2, 3],
color: '#35bb5a',
},
{
start: '2026-10-22T10:00',
end: '2026-10-22T15:00',
title: 'Impact Training',
resource: [2, 3],
color: '#35bb5a',
},
{
start: '2026-10-24T08:30',
end: '2026-10-24T10:00',
title: 'Quick mtg. with Martin',
resource: 3,
color: '#913aa7',
},
{
start: '2026-10-24T12:00',
end: '2026-10-24T13:00',
title: 'General orientation',
resource: [1, 2, 3],
color: '#a71111',
},
{
start: '2026-10-25T10:00',
end: '2026-10-25T11:00',
title: 'Product team mtg.',
resource: [2, 3],
color: '#6e7f29',
},
{
start: '2026-10-26T14:00',
end: '2026-10-26T16:00',
title: 'Stakeholder mtg.',
resource: 1,
color: '#dcd234',
},
{
start: '2026-10-27T10:00',
end: '2026-10-27T14:00',
title: 'Innovation mtg.',
resource: [1, 2],
color: '#de3d83',
},
]);
const myView = useMemo(
() => ({
scheduler: {
type: 'week',
allDay: false,
startDay: 1,
endDay: 5,
startTime: '05:00',
endTime: '22:00',
},
}),
[],
);
const myResources = useMemo(
() => [
{
id: 1,
name: 'Ryan',
color: '#f7c4b4',
},
{
id: 2,
name: 'Kate',
color: '#c6f1c9',
},
{
id: 3,
name: 'John',
color: '#e8d0ef',
},
],
[],
);
const showPopup = useCallback((args) => {
const event = args.event;
const resources = Array.isArray(event.resource) ? event.resource : [event.resource];
// Store temporary event
setTempEvent(args.event);
// Fill popup with the current event data
setTitle(event.title);
setParticipants(resources);
// Set anchor for the popup
setAnchor(args.target ? args.target : args.domEvent.target);
setOpen(true);
}, []);
const handleEventCreated = useCallback(
(args) => {
setIsNewEvent(true);
showPopup(args);
},
[showPopup],
);
const handleEventDoubleClick = useCallback(
(args) => {
setIsNewEvent(false);
showPopup(args);
},
[showPopup],
);
const handleEventDeleted = useCallback(
(args) => {
setEvents(myEvents.filter((item) => item.id !== args.event.id));
},
[myEvents],
);
const handleExtendDefaultEvent = useCallback(() => ({ color: '#4a9e42' }), []);
const popupButtons = useMemo(
() => [
'cancel',
{
text: 'OK',
keyCode: 'enter',
handler: () => {
const updatedEvent = { ...tempEvent, resource: participants, title };
if (isNewEvent) {
setEvents([...myEvents, updatedEvent]);
} else {
setEvents(myEvents.map((item) => (item.id === updatedEvent.id ? updatedEvent : item)));
}
// Update event with the new properties on OK button click
setIsNewEvent(false);
setOpen(false);
},
cssClass: 'mbsc-popup-button-primary',
},
],
[isNewEvent, myEvents, participants, tempEvent, title],
);
const popupClose = useCallback(() => {
if (isNewEvent) {
setEvents(myEvents.filter((item) => item.id !== tempEvent.id));
}
setOpen(false);
}, [isNewEvent, myEvents, tempEvent]);
const titleChange = useCallback((ev) => {
setTitle(ev.target.value);
}, []);
const changeParticipants = useCallback(
(ev) => {
const value = +ev.target.value;
let p;
if (ev.target.checked) {
p = [...participants, value];
} else {
p = participants.filter((item) => item !== value);
}
setParticipants(p);
},
[participants],
);
return (
<div>
<Eventcalendar
data={myEvents}
resources={myResources}
view={myView}
clickToCreate={true}
dragToCreate={true}
dragToMove={true}
dragToResize={true}
onEventCreated={handleEventCreated}
onEventDoubleClick={handleEventDoubleClick}
onEventDeleted={handleEventDeleted}
extendDefaultEvent={handleExtendDefaultEvent}
/>
<Popup
display="anchored"
contentPadding={false}
touchUi={false}
width={350}
buttons={popupButtons}
onClose={popupClose}
isOpen={isOpen}
anchor={anchor}
>
<div className="mbsc-form-group">
<Input label="Title" value={title} onChange={titleChange} inputStyle="box" labelStyle="stacked" />
<div className="mbsc-padding">
<label className="mbsc-txt-muted">Select event participants</label>
</div>
<SegmentedGroup select="multiple" value={participants} onChange={changeParticipants}>
<Segmented value={1}>Ryan</Segmented>
<Segmented value={2}>Kate</Segmented>
<Segmented value={3}>John</Segmented>
</SegmentedGroup>
</div>
</Popup>
</div>
);
}
export default App;
import {
Eventcalendar,
Input,
MbscCalendarEvent,
MbscEventcalendarView,
MbscEventClickEvent,
MbscEventCreatedEvent,
MbscEventDeletedEvent,
MbscPopupButton,
MbscResource,
Popup,
Segmented,
SegmentedGroup,
setOptions ,
} from '@mobiscroll/react';
import { ChangeEvent, FC, useCallback, useMemo, useState } from 'react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
const App: FC = () => {
const [tempEvent, setTempEvent] = useState<MbscCalendarEvent>();
const [title, setTitle] = useState<string>('New event');
const [participants, setParticipants] = useState<Array<number>>([]);
const [anchor, setAnchor] = useState<HTMLElement>();
const [isNewEvent, setIsNewEvent] = useState<boolean>(false);
const [isOpen, setOpen] = useState<boolean>(false);
const myView = useMemo<MbscEventcalendarView>(
() => ({
scheduler: {
type: 'week',
allDay: false,
startDay: 1,
endDay: 5,
startTime: '05:00',
endTime: '22:00',
},
}),
[],
);
const [myEvents, setEvents] = useState<MbscCalendarEvent[]>([
{
start: '2026-10-21T10:00',
end: '2026-10-21T15:00',
title: 'Impact Training',
resource: [2, 3],
color: '#35bb5a',
},
{
start: '2026-10-22T10:00',
end: '2026-10-22T15:00',
title: 'Impact Training',
resource: [2, 3],
color: '#35bb5a',
},
{
start: '2026-10-24T08:30',
end: '2026-10-24T10:00',
title: 'Quick mtg. with Martin',
resource: 3,
color: '#913aa7',
},
{
start: '2026-10-24T12:00',
end: '2026-10-24T13:00',
title: 'General orientation',
resource: [1, 2, 3],
color: '#a71111',
},
{
start: '2026-10-25T10:00',
end: '2026-10-25T11:00',
title: 'Product team mtg.',
resource: [2, 3],
color: '#6e7f29',
},
{
start: '2026-10-26T14:00',
end: '2026-10-26T16:00',
title: 'Stakeholder mtg.',
resource: 1,
color: '#dcd234',
},
{
start: '2026-10-27T10:00',
end: '2026-10-27T14:00',
title: 'Innovation mtg.',
resource: [1, 2],
color: '#de3d83',
},
]);
const myResources = useMemo<MbscResource[]>(
() => [
{
id: 1,
name: 'Ryan',
color: '#f7c4b4',
},
{
id: 2,
name: 'Kate',
color: '#c6f1c9',
},
{
id: 3,
name: 'John',
color: '#e8d0ef',
},
],
[],
);
const showPopup = useCallback((args: MbscEventCreatedEvent | MbscEventClickEvent) => {
const event = args.event;
const resources = Array.isArray(event.resource) ? (event.resource as Array<number>) : [event.resource as number];
// Store temporary event
setTempEvent(event);
// Fill popup with the current event data
setTitle(event.title!);
setParticipants(resources);
// Set anchor for the popup
if (args as MbscEventCreatedEvent) {
setAnchor((args as MbscEventCreatedEvent).target);
} else if (args as MbscEventClickEvent) {
setAnchor((args as MbscEventClickEvent).domEvent.target);
}
setOpen(true);
}, []);
const handleEventCreated = useCallback(
(args: MbscEventCreatedEvent) => {
setIsNewEvent(true);
showPopup(args);
},
[showPopup],
);
const handleEventDoubleClick = useCallback(
(args: MbscEventClickEvent) => {
setIsNewEvent(false);
showPopup(args);
},
[showPopup],
);
const handleEventDeleted = useCallback(
(args: MbscEventDeletedEvent) => {
setEvents(myEvents.filter((item) => item.id !== args.event.id));
},
[myEvents],
);
const popupButtons = useMemo<(string | MbscPopupButton)[]>(
() => [
'cancel',
{
text: 'OK',
keyCode: 'enter',
handler: () => {
const updatedEvent = { ...tempEvent!, resource: participants, title };
if (isNewEvent) {
setEvents([...myEvents, updatedEvent]);
} else {
setEvents(myEvents.map((item) => (item.id === updatedEvent.id ? updatedEvent : item)));
}
// Update event with the new properties on OK button click
setIsNewEvent(false);
setOpen(false);
},
cssClass: 'mbsc-popup-button-primary',
},
],
[myEvents, participants, tempEvent, title, isNewEvent],
);
const onClose = useCallback(() => {
if (isNewEvent) {
setEvents(myEvents.filter((item) => item.id !== tempEvent!.id));
}
setOpen(false);
}, [isNewEvent, myEvents, tempEvent]);
const titleChange = useCallback((ev: ChangeEvent<HTMLInputElement>) => {
setTitle(ev.target.value);
}, []);
const changeParticipants = useCallback(
(ev: ChangeEvent<HTMLInputElement>) => {
const value = +ev.target.value;
let p;
if (ev.target.checked) {
p = [...participants, value];
} else {
p = participants.filter((item) => item !== value);
}
setParticipants(p);
},
[participants],
);
return (
<div>
<Eventcalendar
data={myEvents}
resources={myResources}
view={myView}
clickToCreate={true}
dragToCreate={true}
dragToMove={true}
dragToResize={true}
onEventCreated={handleEventCreated}
onEventDoubleClick={handleEventDoubleClick}
onEventDeleted={handleEventDeleted}
/>
<Popup
display="anchored"
contentPadding={false}
touchUi={false}
width={350}
buttons={popupButtons}
onClose={onClose}
isOpen={isOpen}
anchor={anchor}
>
<div className="mbsc-form-group">
<Input label="Title" value={title} onChange={titleChange} inputStyle="box" labelStyle="stacked" />
<div className="mbsc-padding">
<label className="mbsc-txt-muted">Select event participants</label>
</div>
<SegmentedGroup select="multiple" value={participants} onChange={changeParticipants}>
<Segmented value={1}>Ryan</Segmented>
<Segmented value={2}>Kate</Segmented>
<Segmented value={3}>John</Segmented>
</SegmentedGroup>
</div>
</Popup>
</div>
);
};
export default App;