Event Calendar for React

Learn more

Responsive event calendar with month view, variable week view, range view and event listing.

Supporting one-time, recurring, all-day and multi-day events with pop-over and schedule listing capability. Use it for mobile, desktop and responsive websites.

Shipping with useful features for a refined UX, including:

  • Usage on mobile and desktop with responsive features
  • Single and multi-day events
  • One-time and recurring events
  • Daily, weekly, monthly and custom event schedules
  • Month view, week view and range view
  • Liquid layout with inline display mode
  • Pop-over event listing or list view for schedule
  • Multiple theme support
  • RTL support
  • Full localization


Interested in calendar views? Other demos that could be useful:

Calendar Range


Event calendar demos available for other frameworks.

Viewing demos & code for

light
dark

Change the theme setting here

Event Calendar - Mobile month view

Change demo
Mobile month view

Use the event calendar for mobile, desktop and everything in-between. The content perfectly fills the parent container or the mobile screen in full width. You can chooose to render an agenda-view below the calendar broken up into days ordered chronologically. For more ways to customize the agenda view check out this example.

Interested to see how the event calendar looks on largers screens?  Check out the next demo →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);
        
        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                display="inline"
                data={this.state.myEvents}
                view={{
                    calendar: { type: 'month' },
                    eventList: { type: 'month', scrollable: true }
                }}
                lang=""
                theme=""
            />
        );
    }
}

<div id="content" style="min-height:100%"></div>

Event Calendar - Desktop month view

Change demo
Desktop month view

Depending on the screen width the calendar seamlesly transforms into a desktop-view using the available space more intelligently. The main difference between the mobile and desktop rendering is how the day cells are laid out. People can now see on a glance how many events a day holds and by clicking on day the event list will show up in a pop-over.

Interested to see how the event calendar looks on smaller screens?  Check out the previous demo →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    onEventSelect = (event, inst) => {
        mobiscroll.toast({,
            message: event.event.text
        });
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                calendarHeight={614}
                view={{
                    calendar: {
                        labels: true
                    }
                }}
                onEventSelect={this.onEventSelect}
                data={this.state.myEvents}
            />
        );
    }    
}

<div id="content"></div>

Event Calendar - Responsive

Change demo
Responsive

The event calendar is fully responsive. It adapts to the available space and fills the screen to look good everywhere. While the you don't have to worry about the width the height can be manually adjusted with the calendarHeight property.

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                calendarHeight={513}
                view={{
                    calendar: {
                        labels: true,
                        popover: true
                    }
                }}
                data={this.state.myEvents}
            />
        );
    }    
}

<div id="content"></div>

Event Calendar - Variable weeks

Change demo
Variable weeks

The calendar view supports variable weeks. Save space by only displaying one or two weeks or go for a full month where it makes sense. Use the weeks setting that expects a number of rows. The default is six weeks, but feel free to play around.

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Form>
                <div className="mbsc-grid">
                    <div className="mbsc-row">
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>One week view</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    data={this.state.myEvents}
                                    view={{
                                        calendar: { type: 'week' }
                                    }}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Two week view</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    data={this.state.myEvents}
                                    view={{
                                        calendar: { type: 'week', size: 2 }
                                    }}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Three week view</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    data={this.state.myEvents}
                                    view={{
                                        calendar: { type: 'week', size: 3 }
                                    }}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }    
}

<div id="content"></div>

Event Calendar - Compact daily schedule

Change demo
Compact daily schedule

Use a compact week calendar that you can place at the top of your screen and list a daily schedule below. The calendar view is configured with the calendar object (take a look the previous example) while the agenda view is configured by the eventList setting. For more details on the agenda view see this example. Both are set up inside the view setting.

Days with events are marked with a little dot and days without any events have a localized empty view. Btw. the components are completely localized. Go on and check out this example.

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                data={this.state.myEvents}
                view={{
                    calendar: { type: 'week' },
                    eventList: { type: 'day' }
                }}
            />
        );
    }    
}

<div id="content"></div>

Event Calendar - Switching views

Change demo
Switching views

Dynamically switch views within one calendar instance. Use a UI control to let users do the switching or do it programatically.

The example features a month view with full event schedule, a week view with a weekly schedule and daily event list. Use the option method to dynamically change the settings.

Interested in building more complex views?  See how to synchronize a calendar and a separate event list →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

class App extends React.Component {
     constructor(props) {
        super(props);

        this.state = {
            view: 'month',
            myEvents: [] ,
            calView: {
                calendar: { type: 'month' },
                eventList: { type: 'month', scrollable: true }
            }
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    
    changeView = (event) => {
        var view;
        switch (event.target.value) {
            case 'month':
                view = {
                    calendar: { type: 'month' },
                    eventList: { type: 'month', scrollable: true }
                };
                break;
            case 'week':
                view = {
                    calendar: { type: 'week' },
                    eventList: { type: 'week', scrollable: true }
                };
                break;
            case 'day':
                view = {
                    eventList: { type: 'day', scrollable: true }
                };
                break;
        }
    
        this.setState({
            view: event.target.value,
            calView: view
        });
    }
    
    render () {
        return (
            <div className="md-switching-view-cont">
                <mobiscroll.Form>
                    <mobiscroll.Segmented value="month" name="view" checked={this.state.view === 'month'} onChange={this.changeView}>
                        Month
                    </mobiscroll.Segmented>
                    <mobiscroll.Segmented value="week" name="view" checked={this.state.view === 'week'} onChange={this.changeView}>
                        Week
                    </mobiscroll.Segmented>
                    <mobiscroll.Segmented value="day" name="view" checked={this.state.view === 'day'} onChange={this.changeView}>
                        Day
                    </mobiscroll.Segmented>
                </mobiscroll.Form>
                <div className="md-switching-view-cal-cont">
                    <mobiscroll.Eventcalendar
                        ref="calendar"
                        display="inline"
                        view={this.state.calView}
                        data={this.state.myEvents}
                    />
                </div>
            </div>
        );
    }    
}

<div id="content" style="height:100%"></div>
.md-switching-view-cont {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    height: 100%;
}

.md-switching-view-cal-cont {
    -webkit-flex: 1 0 auto;
    -ms-flex: 1 0 auto;
    flex: 1 0 auto;
}

Event Calendar - Agenda view

Change demo
Agenda view

Use the eventList object, configurable inside the view setting to render a scrollable schedule or agenda view. type and size can be set:

  • day - eventList: { type: 'day', size: 20 } can be configured for a single day or a range of days
  • week - eventList: { type: 'week', size: 3 } can be configured for a single week or a range
  • month - eventList: { type: 'month' } can be configured for a single month or a range
Interested in combining this with a calendar view?  Check out the previous example →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events-new/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Form>
                <div className="mbsc-grid">
                    <div className="mbsc-row">
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Daily schedule</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    view={{
                                        eventList: { type: 'day' }
                                    }}
                                    data={this.state.myEvents}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Weekly schedule</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    view={{
                                        eventList: { type: 'week' }
                                    }}
                                    data={this.state.myEvents}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Monthly schedule</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    view={{
                                        eventList: { type: 'month' }
                                    }}
                                    data={this.state.myEvents}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }    
}

<div id="content"></div>

Event Calendar - Synchronized views

Change demo
Synchronized views

You can usually get away with using a single event calendar instance, but being able to use and synchronize multiple views can come in handy.

In this example we have a two-pane layout with a calendar view on the left and a large agenda view on the right. Because the default rendering of agenda below the calendar doesn't fit we'll be needing two instances. The sync has to happen for both. The day view calls the navigate method of the calendar in its onPageChange event, while the calendar sets the day view with navigate from its onSetDate event.

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);
        this.preventSet = false;
        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    
    onPageChange = (event, inst) => {
        this.preventSet = true;
        this.navigate(this.refs.monthCal.instance, event.firstDay);
    }
    
    onSetDate = (event, inst) => {
         if (!this.preventSet && this.refs.dayCal != undefined) {
            this.navigate(this.refs.dayCal.instance, event.date);
         }
        this.preventSet = false;
    }
    
    navigate = (inst, val) => {
        if (inst) {
            inst.navigate(val);
        }
    }

    render () {
        return (
            <div className="mbsc-grid md-demo-synchronized-views">
                <div className="mbsc-row mbsc-no-padding">
                    <div className="mbsc-col-md-4 mbsc-col-12">
                        <mobiscroll.Eventcalendar
                            lang=""
                            theme=""
                            ref="monthCal"
                            display="inline"
                            view={{
                                calendar: { type: 'month' }
                            }}
                            data={this.state.myEvents}
                            onSetDate={this.onSetDate}
                        />
                    </div>
                    <div className="mbsc-col-md-8 mbsc-col-12 md-col-right">
                        <mobiscroll.Eventcalendar
                            theme=""
                            lang=""
                            ref="dayCal"
                            display="inline"
                            view={{
                                eventList: { type: 'day' }
                            }}
                            data={this.state.myEvents}
                            onPageChange={this.onPageChange}
                        />
                    </div>
                </div>
            </div>
        );
    }    
}

<div id="content"></div>
.md-demo-synchronized-views {
    position: absolute;
    height: 100%;
}

.md-demo-synchronized-views .mbsc-row {
    height: 100%;
}

.md-demo-synchronized-views .md-col-right {
    overflow: auto;
    height: 100%;
    border-left: 1px solid #ccc;
}

Event Calendar - Marked, colored & labels

Change demo
Marked, colored & labels

For additional information you can mark days with colored dots, add labels or completely color the background of the days. This offers means to add more information to the calendar that is valuable to users. Take a look at this example of marked days and description.

You can add these with exact dates, ranges, days of week, days of month and recurring dates. When processing a lot of data you can load the marked days, labels, colors dynamically in the onPageChange event.

Want to show event data and use multiple labels?  We have an example for that →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

class App extends React.Component {
    constructor(props) {
        super(props);

        var now = new Date();
        this.state = {
            marked : [
                { d: '5/1', color: '#ffc400' },
                { d: '12/24', color: '#ffee00' },
                { d: '12/25', color: 'red' },
                { d: new Date(now.getFullYear(), now.getMonth() + 1, 4) },
                { d: new Date(now.getFullYear(), now.getMonth() - 2, 13) },
                { d: new Date(now.getFullYear(), now.getMonth(), 2), color: '#46c4f3' },
                { d: new Date(now.getFullYear(), now.getMonth(), 6), color: '#7e56bd' },
                { d: new Date(now.getFullYear(), now.getMonth(), 11), color: '#7e56bd' },
                { d: new Date(now.getFullYear(), now.getMonth(), 19), color: '#89d7c9' },
                { d: new Date(now.getFullYear(), now.getMonth(), 28), color: '#ea4986' },
                { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#7e56bd' },
                { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#f13f77' },
                { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#89d7c9' },
                { d: new Date(now.getFullYear(), now.getMonth(), 13), color: '#8dec7d' },
                { d: new Date(now.getFullYear(), now.getMonth(), 21), color: '#ffc400' },
                { d: new Date(now.getFullYear(), now.getMonth(), 21), color: '#8dec7d' },
                { start: new Date(now.getFullYear(), now.getMonth() + 1, 15), end: new Date(now.getFullYear(), now.getMonth() + 1, 18), color: '#f4511e' }
            ],
            colors: [
                { d: '12/8', background: '#9ccc65' },
                { d: '5/1', background: 'red' },
                { d: '12/24', background: "#fff568" },
                { d: '12/25', background: "#e88080" },
                { d: new Date(now.getFullYear(), now.getMonth() + 1, 4), background: '#cfd8dc' },
                { d: new Date(now.getFullYear(), now.getMonth() + 2, 24), background: '#9575cd' },
                { d: new Date(now.getFullYear(), now.getMonth() - 2, 13), background: '#d4e157' },
                { d: new Date(now.getFullYear(), now.getMonth() - 1, 6), background: "#f4511e" },
                { d: new Date(now.getFullYear(), now.getMonth() + 1, 6), background: '#46c4f3' },
                { d: new Date(now.getFullYear(), now.getMonth() + 1, 22), background: '#7e56bd' },
                { d: new Date(now.getFullYear(), now.getMonth() - 1, 11), background: '#46c4f3' },
                { d: new Date(now.getFullYear(), now.getMonth() - 1, 29), background: '#7e56bd' },
                { d: new Date(now.getFullYear(), now.getMonth(), 2), background: '#46c4f3' },
                { d: new Date(now.getFullYear(), now.getMonth(), 3), background: '#7e56bd' },
                { d: new Date(now.getFullYear(), now.getMonth(), 11), background: '#f13f77' },
                { d: new Date(now.getFullYear(), now.getMonth(), 19), background: '#8dec7d' },
                { d: new Date(now.getFullYear(), now.getMonth(), 28), background: '#ea4986' },
                { start: new Date(now.getFullYear(), now.getMonth() + 1, 15), end: new Date(now.getFullYear(), now.getMonth() + 1, 18), text: 'Conference', background: '#f4511e' }
            ],
            labels: [
                { d: '12/25', text: 'Christmas', color: "#f48fb1" },
                { d: '1/1', text: 'New year' },
                { d: '12/1', text: 'Meeting', color: '#ffc400' },
                { d: new Date(now.getFullYear(), now.getMonth() + 1, 4), text: 'Spa day', color: '#cfd8dc' },
                { d: new Date(now.getFullYear(), now.getMonth() + 2, 24), text: 'BD Party', color: '#9ccc65' },
                { d: new Date(now.getFullYear(), now.getMonth() - 2, 13), text: 'Exams', color: '#d4e157' },
                { d: new Date(now.getFullYear(), now.getMonth() - 1, 6), text: 'Trip', color: "#f4511e" },
                { d: new Date(now.getFullYear(), now.getMonth() + 1, 6), color: '#46c4f3', text: 'Pizza Night' },
                { d: new Date(now.getFullYear(), now.getMonth() + 1, 22), color: '#7e56bd', text: 'Beerpong' },
                { d: new Date(now.getFullYear(), now.getMonth() - 1, 11), color: '#46c4f3', text: 'Anniversary' },
                { d: new Date(now.getFullYear(), now.getMonth() - 1, 29), color: '#7e56bd', text: 'Pete BD' },
                { d: new Date(now.getFullYear(), now.getMonth(), 2), color: '#46c4f3', text: 'Ana BD' },
                { d: new Date(now.getFullYear(), now.getMonth(), 3), color: '#7e56bd', text: 'Concert' },
                { d: new Date(now.getFullYear(), now.getMonth(), 11), color: '#f13f77', text: 'Trip' },
                { d: new Date(now.getFullYear(), now.getMonth(), 19), color: '#8dec7d', text: 'Math exam' },
                { d: new Date(now.getFullYear(), now.getMonth(), 28), color: '#ea4986', text: 'Party' },
                { start: new Date(now.getFullYear(), now.getMonth() + 1, 15), end: new Date(now.getFullYear(), now.getMonth() + 1, 18), text: 'Conference', color: '#f4511e' }
            ]
        };
    }
    
    render() {
        return (
            <mobiscroll.Form>
                <div className="mbsc-grid">
                    <div className="mbsc-row">
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Marked days</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    marked={this.state.marked}
                                    display="inline"
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Colored days</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    colors={this.state.colors}
                                    display="inline"
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Labels</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    labels={this.state.labels}
                                    display="inline"
                                />
                            </mobiscroll.FormGroup>
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }   
}

<div id="content"></div>

Event Calendar - Events as labels

Change demo
Events as labels

Events can be displayed a couple of different ways. Most of the time showing the event data inside and across the calendar cells is the way to go.

When configuring the calendar object, you can set labels: true. All of this happens under the view setting.

Rather show events in a pop-over?  Take a look at the next example →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                calendarHeight={614}
                view={{
                    calendar: {
                        labels: true
                    }
                }}
                data={this.state.myEvents}
            />
        );
    }    
}

<div id="content"></div>

Event Calendar - Events in popover

Change demo
Events in popover

Besides displaying event labels or listing them in an agenda view, you can have them show up in a pop-over. Set it up though the calendar: {popover: true} object inside the view setting. Using the popover setting saves vertical space and provides a subtle cue to the user that there are events. A small dot will apear in day cells with events.

Would a full-blown event list help?  Take a look at the next example →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                data={this.state.myEvents}
                showEventCount={true}
            />
        );
    }    
}

<div id="content"></div>

Event Calendar - Events in agenda view

Change demo
Events in agenda view

The calendar view ships with two methods for listing events. Either as event labels or in a pop-over. Besides these two the third way is to configure an event list under the view setting.

Configure the event list like this view: {eventList: {type: 'month'}}.

Looking for more options for event lists?  Try the daily/weekly/monthly schedule →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <div className="mbsc-grid-fixed mbsc-grid-md md-event-list-agenda">
                <mobiscroll.Eventcalendar
                    lang=""
                    theme=""
                    display="inline"
                    data={this.state.myEvents}
                    view={{
                        calendar: { type: 'month' },
                        eventList: { type: 'month', scrollable: true }
                    }}
                    data={this.state.myEvents}
                />
            </div>
        );
    }    
}

<div id="content" class="md-event-list-agenda-cont"></div>
.md-event-list-agenda {
    min-height: 100%;
}

.md-event-list-agenda-contmbsc-page > .mbsc-page {
    height: 100%;
}

Event Calendar - Custom event data

Change demo
Custom event data

If you want to display complex event data, you can do it by passing HTML as the text. This can be full fledged HTML with a layout, CSS, styling, emojis and so on.

When the events are renderend, instead of just plain text, the component will print the styled HTML markup. Besides that the layout, time will be kept the same as with plain text. If you have something completely different in mind, you can use the listview to render the events instead of relying on the event calendar agenda view. Psst... the listview supports slide gestures.

Have a different event list in mind?  Use the listview with gestures →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        var now = new Date();
        
        this.state = {
            myEvents: [{
                d: new Date(now.getFullYear(), now.getMonth(), 8, 8, 0),
                text: 'Green box to post office',
                color: '#6e7f29',
            }, {
                start: new Date(now.getFullYear(), now.getMonth(), 8, 8, 45),
                end: new Date(now.getFullYear(), now.getMonth(), 8, 9, 0),
                text: 'Quick mtg. with Martin <div class="mbsc-bold md-event-desc">Deal offer</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>13 Walnut Avenue, Eden Hazelton</div><span class="md-event-emoji">🎉</span>',
                color: '#de3d83',
                category: 'meeting',
                location: '13 Walnut Avenue, Eden Hazelton'
            }, {
                start: new Date(now.getFullYear(), now.getMonth(), 8, 9, 30),
                end: new Date(now.getFullYear(), now.getMonth(), 8, 10, 30),
                text: 'Product team mtg. <div class="mbsc-bold md-event-desc">Promote Justin</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">💬</span>',
                color: '#f67944',
                category: 'meeting',
                location: 'Office'
            }, {
                start: new Date(now.getFullYear(), now.getMonth(), 8, 11, 0),
                end: new Date(now.getFullYear(), now.getMonth(), 8, 11, 30),
                text: 'Stakeholder mtg. <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">💬</span>',
                color: '#f67944',
                category: 'meeting',
                location: 'Office'
            }, {
                start: new Date(now.getFullYear(), now.getMonth(), 8, 13, 0),
                end: new Date(now.getFullYear(), now.getMonth(), 8, 13, 30),
                text: 'Pick up Kate <div class="mbsc-bold md-event-desc">Lunch @ Butcher\'s</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>38 Hardman Road, Cedar Court</div><span class="md-event-emoji">🍔</span>',
                color: '#00aabb',
                category: 'date',
                location: '38 Hardman Road, Cedar Court'
            }, {
                start: new Date(now.getFullYear(), 9, 9, 9),
                text: 'Coffee with Steve <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>1334 Rose Street, Walpole</div><span class="md-event-emoji">☕</span>',
                color: '#00aabb',
                category: 'coffee break',
                location: '1334 Rose Street, Walpole'
            }, {
                start: new Date(now.getFullYear(), 10, 2, 12),
                text: 'Trip to England <div class="mbsc-bold md-event-desc">Family visit</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Evergreen Drive</div><span class="md-event-emoji">✈</span>',
                color: '#00aabb',
                category: 'vacation',
                location: 'Evergreen Drive'
            }, {
                start: new Date(now.getFullYear(), 4, 3, 11),
                end: new Date(now.getFullYear(), 4, 3, 12),
                text: 'Photoshoot <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>431 Durham Road, Indianapolis</div><span class="md-event-emoji">📸</span>',
                color: '#00aabb',
                category: 'hobby',
                location: '431 Durham Road, Indianapolis'
            }, {
                start: new Date(now.getFullYear(), now.getMonth(), 17, 30, 0),
                text: 'Shopping with mom <div class="mbsc-bold md-event-desc">List on the fridge</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>587 Grant Street, Montpelier</div><span class="md-event-emoji">🛒</span>',
                color: '#f67944',
                category: 'hobby',
                location: '587 Grant Street, Montpelier'
            }, {
                d: (now.getMonth() + 1) + '/14',
                text: 'Dexter BD <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>52 Crescent Street, Phoenix</div><span class="md-event-emoji">🎂</span>',
                color: '#37bbe4',
                category: 'party',
                location: '52 Crescent Street, Phoenix'
            }, {
                d: (now.getMonth() + 1) + '/5',
                text: 'Luke BD <div class="mbsc-bold md-event-desc">Party at 4 PM</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>57 Mulberry Street, Fremont</div><span class="md-event-emoji">🎉</span>',
                color: '#37bbe4',
                category: 'birthday',
                location: '57 Mulberry Street, Fremont'
            }, {
                d: 'w3',
                text: 'Employment <div class="mbsc-bold md-event-desc">Semi-weekly</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">✍</span>',
                color: '#635045',
                category: 'meeting',
                location: 'Office'
            }, {
                d: 'w5',
                text: 'Employment <div class="mbsc-bold md-event-desc">Semi-weekly</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">✍</span>',
                color: '#ff9966',
                category: 'meeting',
                location: 'Office'
            }, {
                start: new Date(now.getFullYear(), 1, 7),
                end: new Date(now.getFullYear(), 1, 25),
                text: 'Dean OFF <div class="mbsc-bold md-event-desc">Vacation</div><span class="md-event-emoji">🌄</span>',
                color: '#99ff33',
                category: 'vacation'
            }, {
                start: new Date(now.getFullYear(), 2, 1),
                end: new Date(now.getFullYear(), 2, 14),
                text: 'Mike probation time <div class="mbsc-bold md-event-desc">Jack\'s supervision</div><div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Office</div><span class="md-event-emoji">📋</span>',
                color: '#e7b300',
                category: 'work',
                location: 'Office'
            }, {
                start: new Date(now.getFullYear(), 4, 7),
                end: new Date(now.getFullYear(), 4, 16),
                text: 'John OFF <div class="mbsc-bold md-event-desc">Sick leave</div><span class="md-event-emoji">💊</span>',
                color: '#669900',
                category: 'sickness',
            }, {
                start: new Date(now.getFullYear(), 5, 1),
                end: new Date(now.getFullYear(), 5, 11),
                text: 'Carol OFF <div class="mbsc-bold md-event-desc">Personal problems</div>',
                color: '#6699ff',
                category: 'vacation'
            }, {
                start: new Date(now.getFullYear(), 6, 2),
                end: new Date(now.getFullYear(), 6, 17),
                text: 'Business trip <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>5th Street North</div><span class="md-event-emoji">🚌</span>',
                color: '#cc9900',
                category: 'vacation',
                location: '5th Street North'
            }, {
                start: new Date(now.getFullYear(), 7, 6),
                end: new Date(now.getFullYear(), 7, 14),
                text: 'Ashley OFF <div class="mbsc-bold md-event-desc">On a trip</div><span class="md-event-emoji">🚌</span>',
                color: '#339966',
                category: 'vacation'
            }, {
                start: new Date(now.getFullYear(), 8, 10),
                end: new Date(now.getFullYear(), 8, 20),
                text: 'Marisol OFF <div class="mbsc-bold md-event-desc">Family time</div><span class="md-event-emoji">👨‍‍👧‍👦</span>',
                color: '#8701a9',
                category: 'vacation'
            }, {
                start: new Date(now.getFullYear(), 9, 1),
                end: new Date(now.getFullYear(), 9, 4),
                text: 'Sharon OFF <div class="mbsc-bold md-event-desc">Sick leave</div><span class="md-event-emoji">🤕</span>',
                color: '#cc6699',
                category: 'sickness'
            }, {
                d: '12/25',
                text: 'Christmas Day <div class="md-event-loc mbsc-txt-muted"><span class="mbsc-ic mbsc-ic-location"></span>Home</div><span class="md-event-emoji">🎄</span>',
                color: '#ff0066',
                category: 'holiday',
                location: 'Home'
            }, {
                d: '1/1',
                text: 'New Year\'s day <span class="md-event-emoji">🎆</span>',
                color: '#99ccff',
                category: 'holiday'
            }, {
                d: '4/1',
                text: 'April Fool\'s Day <div class="mbsc-bold md-event-desc">Just kidding!</div><span class="md-event-emoji">🤡</span>',
                color: '#ff6666',
                category: 'joke'
            }, {
                d: '11/2',
                text: 'File Form 720 for the third quarter <span class="md-event-emoji">📃</span>',
                color: '#a63e14',
                category: 'work'
            }]
        };
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                data={this.state.myEvents}
                view={{
                    calendar: { type: 'month' },
                    eventList: { type: 'month', scrollable: true }
                }}
                cssClass="md-custom-data"
            />
        );
    }    
}

<div id="content" style="min-height:100%"></div>
.md-custom-data .mbsc-event-txt {
    line-height: 1.3em;
}

.md-event-loc {
    padding-top: .5em;
    font-size: 12px;
}

.md-event-emoji {
    position: absolute;
    top: 19px;
    right: 15px;
    font-size: 14px;
}

.md-event-desc+.md-event-loc+.md-event-emoji {
    top: 30px;
}

.md-event-loc .mbsc-ic-location {
    margin-right: 5px;
}

Event Calendar - Custom rendering with listview

Change demo
Custom rendering with listview

While we have flexible event listing, sometimes you might need something entirely different. For those situations we have the listview.

You will be passing the events to the calendar like before, but the event listing will be handled externally. Use the Event API to query the events and create any layout you desire. The listview is super-useful to render anything that is a list and it event supports gestures, so you can do things like swipe away to remove an event. Try swiping the events left and right.

Do you want to keep the aganda view and customize the content?  Pass HTML as the event text →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

const formatDate = mobiscroll.util.datetime.formatDate;

class ListItem extends React.Component {
    action = (txt) => {
        mobiscroll.toast({
            message: 'View clicked'
        });
    }
    render() {
        const imgSrc = 'https://img.mobiscroll.com/demos/' + this.props.item.img;
        const star = 'mbsc-ic mbsc-ic-star3 md-listview-rendering-icon' + (this.props.item.starred ? '' : ' md-hide-star');

        if (this.props.item.divider) {
            return <li data-role="list-divider">{this.props.item.date}</li>;
        }
        else {
            return <li data-id={this.props.item.id}>
                <div className="md-listview-rendering-content">
                    <div className="md-listview-rendering-date">
                        {this.props.item.time}
                    </div>
                    <button className="mbsc-btn mbsc-btn-filled mbsc-btn-info md-listview-rendering-btn" onClick={() => { this.action() }}>View</button>
                    <div className="md-listview-rendering-title mbsc-bold">
                        {this.props.item.title}
                        <span className={star}></span>
                    </div>
                    <div className="md-listview-rendering-loc mbsc-italic">
                        {this.props.item.loc}
                    </div>
                </div>
                <mobiscroll.Card>
                    <img src={imgSrc} draggable="false" />
                </mobiscroll.Card>
            </li>;
        }
    }
}

class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            events: [],
            list: [],
            calHeader: ''
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events-listview/', (array) => {
            this.setState({
                events: array
            });
        }, 'jsonp');
    }
    onPageLoaded = (event, inst) => {
        const first = event.firstDay;
        const last = new Date(first.getFullYear(), first.getMonth(), first.getDate() + 7);
        
        this.getEvents(first, last);
    }
    onPosition = (event, inst) => {
        setTimeout(() => {
            let eventList = ReactDOM.findDOMNode(this.lvRendering);
            const top = eventList.getBoundingClientRect().top + document.body.scrollTop;
    
            setTimeout(() => {
                eventList.style.height = window.innerHeight - top + 'px';
            });
        });
    }
    onDayChange = (event, inst) => {
        // find all day headers
        const formattedDate = formatDate('yy/mm/dd', event.date);
        let headers = ReactDOM.findDOMNode(this.list).querySelectorAll('li[data-role="list-divider"]');
        let day;

        for (let i = 0; i < headers.length; i++) {
            if (headers[i].innerHTML == formattedDate) {
                day = headers[i];
            }
        }

        if (day !== undefined) {
            setTimeout(function () {
                day.scrollIntoView({ behavior: 'smooth', block: 'start' });
            });
        }
    }
    getEvents (first, last) {
        const events = this.state.events;
        const list = [];

        for (let i = 0; i < events.length; ++i) {
            let item = events[i];
            item.d = new Date(item.d);
            item.time = formatDate('D d M h:iia', item.d);

            if (item.d >= first && item.d < last) {
                const curr = item.d.getDay();
                const prev = events[i - 1] ? events[i - 1].d.getDay() : -1;
                
                // add divider if needed
                if (curr != prev) {
                    list.push({ 
                        id: 'divider-' + i,
                        divider: true,
                        date: formatDate('yy/mm/dd', item.d)
                    });
                }
                list.push(item);
            }
        }

        this.setState({
            list: list
        });
    }
    stages = {
        left: [{
            color: '#55ad55',
            text: 'Interested',
            confirm: true,
            action: (event, inst) => {
                let el = event.target.querySelector('.md-listview-rendering-icon');

                el.classList.remove('md-hide-star');
                
                mobiscroll.toast({
                    message: 'Interested'
                });
            }
        }],
        right: [{
            color: '#b93838',
            text: 'Not Interested',
            confirm: true,
            action: (event, inst) => {
                const events = this.state.events.slice(0);
                const id = event.target.getAttribute('data-id');
                const index = events.findIndex(item => item.id == id);
                
                events.splice(index, 1);
                this.setState({
                    events: events
                });
                
                console.log(this.state.list);

                mobiscroll.toast({
                    message: 'Not Interested'
                });
            }
        }]
    }
    setCal = (comp) => {
        this.calendar = comp;
    }
    setRendering = (comp) => {
        this.lvRendering = comp;
    }
    setList = (comp) => {
        this.list = comp;
    }
    render () {
        return (
            <div className="md-listview-rendering-data">
                <mobiscroll.Eventcalendar
                    ref={this.setCal}
                    display="inline"
                    firstDay={1}
                    view={{
                        calendar: {
                            type: 'week'
                        }
                    }}
                    data={this.state.events}
                    onPageLoaded={this.onPageLoaded}
                    onPosition={this.onPosition}
                    onDayChange={this.onDayChange}
                />
                <div ref={this.setRendering} className="md-demo-listview-rendering">
                    <mobiscroll.Listview
                        ref={this.setList}
                        data={this.state.list}
                        itemType={ListItem}
                        animateAddRemove={false}
                        stages={this.stages}
                    >
                    </mobiscroll.Listview>
                </div>
            </div>
        );
    }    
}

<div id="content"></div>
.md-listview-rendering-content {
    padding: 16px 16px 0;
    position: relative;
}

.md-listview-rendering-date {
    font-size: 15px;
    color: #5e5e5e;
    margin-bottom: 6px;
}

.md-listview-rendering-title {
    font-size: 18px;
    margin-bottom: 4px;
}

.md-hide-star {
    display: none;
}

.md-listview-rendering-icon {
    color: #e0e040;
    margin: 0 6px;
}

.md-listview-rendering-loc {
    font-size: 14px;
    color: #5e5e5e;
}

.md-listview-rendering-img {
    max-width: 100%;
}

.md-listview-rendering-data .mbsc-lv-ic-s {
    color: #e0e040;
}

.md-listview-rendering-data .md-listview-rendering-btn {
    position: absolute;
    top: 21px;
    z-index: 1;
    transition: background-color .3s ease-out;
}

.mbsc-ltr .md-listview-rendering-data .md-listview-rendering-btn {
    right: 12px;
}

.mbsc-rtl .md-listview-rendering-data .md-listview-rendering-btn {
    left: 12px;
}

.md-listview-rendering-data .md-demo-listview-rendering {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

Event Calendar - Date types

Change demo
Date types

The event calendar support multiple data types. The data, marked, colors and labels objects all understand the different formats. Let's see how they look:

  • JS date objects - new Date(1995, 11, 17, 15, 24)
  • ISO date strings - '2008-09-15T15:53:00'
  • Localized date strings - '04/25/2010 8:15 AM'
  • Moment.js objects - moment([2018, 3, 27, 12, 15])
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: '',
    display: 'inline'
};

class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            dateObjData: [],
            dateStrData: [],
            momentJsData: []
        };
    }
    
    addDate = () => {
        const newItem = {
            start: new Date(2019, 4, 8, 10, 45),
            end: new Date(2019, 4, 8, 11, 45),
            text: 'New Event'
       };
       this.setState(state => ({
           dateObjData: [...state.dateObjData, newItem]
       })); 
        
        this.dateObj.instance.navigate(new Date(2019, 4, 8));
    };
    
    addISO = () => {
        const newItem = {
            start: '2019-09-15T15:30:00',
            end: '2019-09-15T16:00:00',
            text: 'New Event'
       };
       this.setState(state => ({
           dateStrData: [...state.dateStrData, newItem]
       })); 
        
        this.dateStr.instance.navigate('2019-09-15');
    };
    
    addMoment = () => {
        const newItem = {
            // make sure that moment js is loaded
            start: moment([2019, 3, 20, 18]),
            end: moment([2019, 3, 20, 20]),
            text: 'New Event'
       };
       this.setState(state => ({
           momentJsData: [...state.momentJsData, newItem]
       })); 
        
        this.momentJs.instance.navigate(moment([2019, 3, 20]));
    };
    
    setDateObj = (comp) => {
        this.dateObj = comp;
    };
    
    setDateStr = (comp) => {
        this.dateStr = comp;
    };
    
    setMomentJs = (comp) => {
        this.momentJs = comp;
    };
    
    render() {
        return (
            <mobiscroll.Form>
                <div className="mbsc-grid">
                    <div className="mbsc-row">
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Date object</mobiscroll.FormGroupTitle>
                                <div className="mbsc-btn-group-block">
                                    <mobiscroll.Button onClick={this.addDate} className="mbsc-btn-primary">start: new Date(2019, 4, 8, 10, 45) <br /> end: new Date(2019, 4, 8, 11, 45)</mobiscroll.Button>
                                </div>
                                <mobiscroll.Eventcalendar
                                    ref={this.setDateObj}
                                    data={this.state.dateObjData}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>ISO string</mobiscroll.FormGroupTitle>
                                <div className="mbsc-btn-group-block">
                                    <mobiscroll.Button onClick={this.addISO} className="mbsc-btn-primary">start: 2019-09-15T15:30:00 <br /> end: 2019-09-15T16:00:00</mobiscroll.Button>
                                </div>
                                <mobiscroll.Eventcalendar
                                    ref={this.setDateStr}
                                    data={this.state.dateStrData}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Moment js</mobiscroll.FormGroupTitle>
                                <div className="mbsc-btn-group-block">
                                    <mobiscroll.Button onClick={this.addMoment} className="mbsc-btn-primary">start: moment([2019, 3, 20, 18]) <br /> end: moment([2019, 3, 20, 20])</mobiscroll.Button>
                                </div>
                                <mobiscroll.Eventcalendar
                                    ref={this.setMomentJs}
                                    data={this.state.momentJsData}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }    
}

<div id="content"></div>

Event Calendar - Event data structure

Change demo
Event data structure

The event data structure for is straightforward with a couple of base properties that the component understands and uses to render the UI. Besides the base properties you can add any custom property, like location, description ...

  • text - Defines the event text. This can be plaintext or HTML
  • color - Defines the event color
  • start - Sets the start date and time for the event. It can be a date object, ISO date string or moment.js object
  • end - Sets the end date and time for the event. The same formats are supported as for start

This is how a simple event looks like with a couple of extra properties:

{
    text: 'Product planning',
    color: '#56ca70',
    start: new Date(2018, 11, 21, 13, 00),
    end: new Date(2018, 11, 21, 14, 00),
    busy: true,
    description: 'Weekly meeting with team',
    location: 'Office'
}

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

const text = 'Sarah OFF';
const color = '#56ca70';
const start = new Date(2019, 11, 21, 13, 0);
const end = new Date(2019, 11, 21, 14, 0);
const busy = true;
const desc = 'Sick leave';
const loc = 'Home';

class App extends React.Component {
    constructor(props) {
        super(props);
        
        this.state = {
            events: []
        };
    }
    
    addEvent = () => {
        const newItem = {
            text: text,
            color: color,
            start: start,
            end: end,
            busy: busy,
            desc: desc,
            loc: loc
        };
        this.setState(state => ({
            events: [...state.events, newItem]
        }));
    }

    render() {
        return (
            <mobiscroll.Form>
                <div className="mbsc-grid">
                    <div className="mbsc-row mbsc-justify-content-center">
                        <div className="mbsc-col-sm-12 mbsc-col-md-5">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Base properties</mobiscroll.FormGroupTitle>
                                <label>
                                    Text
                                    <input value={text} disabled />
                                </label>
                                <label>
                                    Color
                                    <input value={color} disabled />
                                </label>
                                <label>
                                    Start
                                    <input value={start} disabled />
                                </label>
                                <label>
                                    End
                                    <input value={end} disabled />
                                </label>
                            </mobiscroll.FormGroup>
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Add any property you'd like</mobiscroll.FormGroupTitle>
                                <label>
                                    Busy
                                    <input value={busy} disabled />
                                </label>
                                <label>
                                    Description
                                    <input value={desc} disabled />
                                </label>
                                <label>
                                    Location
                                    <input value={loc} disabled />
                                </label>
                            </mobiscroll.FormGroup>
                            <button type="button" onClick={this.addEvent}>Add event</button>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-5">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Event calendar</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    data={this.state.events}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }    
}

<div id="content"></div>

Event Calendar - Events from remote API

Change demo
Events from remote API

Data sources for the event calendar include inline data, you can load all events at once from an external resource or load data on demand. This example shows how to use an external API to load the data from. The same JSON format applies for the events, but it's base properties and optional fields. The previous demo shows what data format to follow. More information about the data setting can be seen in the documentation.

Looking for load on demand?  Dynamically load events on month change →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                view={{
                    calendar: { type: 'month' },
                    eventList: { type: 'month', scrollable: true }
                }}
                data={this.state.myEvents}
            />
        );
    }    
}


<div id="content" style="min-height:100%"></div>

Event Calendar - Loading events on demand

Change demo
Loading events on demand

The calendar supports remote and local data sources. Besides that, events can be populated on initialization or loaded on demand. Getting the events in real time as the user navigates improves load performance and always serves the most recent data.

Use the onPageLoading lifecycle event to load the data when needed.

Interested in pre-loading event data all at once?  Load events from a remote API →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            events: []
        };
    }
    
    onPageLoading = (event, inst) => {
        const year = event.firstDay.getFullYear();
        const month = event.firstDay.getMonth();
        const data = this.state.events.slice(0);
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/monthlyevents/?year=' + year + '&month=' + month, (result) => {
            for (let i = 0; i < result.length; i++) {
                data.push({
                    start: result[i].start,
                    end: result[i].end,
                    d: result[i].d,
                    text: result[i].text,
                    color: result[i].color
                });
            }

            this.setState({
                events: data
            });
            
        }, 'jsonp');
    }
    
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                view={{
                    calendar: { type: 'month' },
                    eventList: { type: 'month' }
                }}
                data={this.state.events}
                onPageLoading={this.onPageLoading}
            />
        );
    }    
}

<div id="content"></div>

Event Calendar - Loading from Google calendar

Change demo
Loading from Google calendar
React Event calendar demo with google calendar sync. Load events dynamically from multiple google calendars. For React.
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            events: [],
            calApiLoaded: false,
            clientId: '<YOUR_CLIENT_ID>',
            eventColors: {},
            calColors: {},
            calIds: {},
            firstDay: new Date(),
            lastDay: new Date(),
            cals: []
        };
    }
    
    componentDidMount() {
        this.loadGoogleSDK();
    }
    c
    // Load the SDK asynchronously
    loadGoogleSDK = () => {
        (function (d, s, id) {
            const fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) {
                return;
            }
            const js = d.createElement(s);
            js.id = id;
            js.src = "//apis.google.com/js/client.js?onload=onGoogleLoad";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'google-jssdk'));
    }
    
    onGoogleLoad() {
        gapi.auth.init(() => {});
    }
    
    getEventProps(event, calId) {
        return {
            start: event.start.date || event.start.dateTime,
            end: ((new Date(event.end.date) - new Date(event.start.date)) / 86400000 == 1 ? '' : event.end.date) || event.end.dateTime,
            text: event.summary || 'No Title',
            calendarId: calId,
            color: this.state.eventColors[event.colorId] || this.state.calColors[calId]
        };
    }
    
    onPageLoading = (event, inst) => {
        const state = this.state;
        const year = event.firstDay.getFullYear();
        const month = event.firstDay.getMonth();
        
        this.setState({
            firstDay: new Date(year, month - 1, -7),
            lastDay: new Date(year, month + 2, 14)
        });

        if (state.calApiLoaded) {
            let batch = gapi.client.newBatch();
            for (let id in state.calIds) {
                batch.add(gapi.client.calendar.events.list({
                    'calendarId': calId,
                    'timeMin': firstDay.toISOString(),
                    'timeMax': lastDay.toISOString()
                }), { id: calId });
            }
            if (state.calIds) {
                batch.then((resp) => {
                    let eventList = [];
                    for (let r in res) {
                        let events = res[r].result.items;
                        for (let i = 0; i < events.length; ++i) {
                            eventList.push(this.getEventProps(events[i], r));
                        }
                    }
                    this.setState({
                        events: eventList
                    });
                });
             }
        }
    }
    
    onChange(event) {
        const state = this.state;
        const calId = event.target.getAttribute('id');
        let eventList = state.events.slice(0);
        const calIds = Object.assign({}, this.state.calIds);
        
        if (event.target.checked) {
            // Add events from this calendar
            calIds[calId] = true;
            gapi.client.calendar.events.list({
                'calendarId': calId,
                'timeMin': state.firstDay.toISOString(),
                'timeMax': state.lastDay.toISOString()
            }).then((resp)=> {
                
                const events = resp.result.items;
                for (let i = 0; i < events.length; ++i) {
                    eventList.push(this.getEventProps(events[i], calId));
                }
                this.setState({
                    events: eventList,
                    calIds: calIds
                });
            });
        } else {
            // Remove events from this calendar
            eventList = state.events.filter(x => x.calendarId !== calId);
            calIds[calId] = false;
            this.setState({
                events: eventList,
                calIds: calIds
            });
        }
    }
    
    auth (ev) {
        const state = this.state;
        const btn = ev.target;
        // Google auth
        if (!state.calApiLoaded) {
            gapi.auth.authorize({
                client_id: state.clientId,
                scope: 'https://www.googleapis.com/auth/calendar',
                immediate: false
            }).then((authResult) => {
                // Load the calendar API
                if (authResult) {
                    return gapi.client.load('calendar', 'v3');
                }
            }).then(() => {
                this.setState({
                    calApiLoaded: true
                });
                btn.style.display = 'none';
                // Load calendar colors
                return gapi.client.calendar.colors.get({
                    'fields': 'event'
                });
            }).then((resp) => {
                const ev = resp.result.event;
                const eventColors = Object.assign({}, this.state.eventColors);
                for (let i = 0; i < ev.length; ++i) {
                    eventColors[i] = ev[i].color.background;
                    this.setState({
                        eventColors: eventColors
                    });
                }
                // Load calendar list
                return gapi.client.calendar.calendarList.list({
                    'fields': 'items(backgroundColor,colorId,description,id,summary)'
                });
            }).then((resp) => {
                // Populate the calendar list
                let html = '';
                const cals = resp.result.items;
                const calColors = Object.assign({}, this.state.calColors); 
                const state = this.state;
                
                 for (let i = 0; i < cals.length; ++i) {
                    const cal = cals[i];
                    
                    calColors[cal.id] = cal.backgroundColor;
                    
                    const newItem = {
                        id: cal.id, 
                        val: false,
                        summary: cal.summary, 
                        description: cal.description || 'No description'
                    };
                    
                    this.setState({
                        cals: [...state.cals, newItem]
                     });
                 }

                 this.setState({
                     calColors: calColors
                 });

             }).catch((err) => {
                // TODO test for more errors
                mobiscroll.toast({,
                    message: err.error
                });
            });
        }
    }
    
    render() {
        return (
            <mobiscroll.Form ref="form" lang="" theme="">
                <div className="mbsc-grid">
                    <div className="mbsc-row">
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.Button onClick={e => this.auth(e)} className="mbsc-btn-block">Add Google Calendars</mobiscroll.Button>
                                <div>
                                    {this.state.cals.map((cal, index) => {
                                        return <mobiscroll.Switch key={cal.id} id={cal.id} value={cal.val} onChange={this.onChange}>
                                            {cal.summary}
                                            <span className="mbsc-desc">{cal.description}</span>
                                        </mobiscroll.Switch>;
                                    })}
                                </div>
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-8">
                            <mobiscroll.FormGroup>
                                <mobiscroll.Eventcalendar
                                    lang=""
                                    theme=""
                                    display="inline"
                                    view={{
                                        calendar: {
                                            labels: true
                                        }
                                    }}
                                    data={this.state.events}
                                    onPageLoading={this.onPageLoading}
                                />
                            </mobiscroll.FormGroup>
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }    
}

<div id="content"></div>

Event Calendar - Add/delete event

Change demo
Add/delete event

The component renders event data that it gets from an API, however you can manually add and delete events in real time. The idea is to pass the event in the correct format, which means it needs a couple of base properties:

  • d or start & end - Defines the date and length of the event
  • text - Defines the lable for the event, which can be anything from text to something more complex like HTML
  • color - Defines the color of the event
  • allDay - Sets if the event is an all-day event or not
  • everything else you would like - You can add any additional data that makes sense, like busy or location...

After you have the data object ready with the event data you can pass it to the addEvent method. While the event calendar doesn't ship with a built-in form for adding events, you can use the popup component along with inputs & fields to build the form you need.

Deleting events can be done just as simply by calling the removeEvent method

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

const popupBtn = [{
        text: 'Add event',
        handler: 'set'
    },
    'cancel'
];

const monthView = {
    calendar: { type: 'month' }
};

const dayView = {
    eventList: { type: 'day' }
};
    
const respRange = {
    large: {
        touchUi: false
    }
};

const now = new Date();
const btn = '<button type="button" class="mbsc-btn mbsc-btn-outline mbsc-btn-danger md-delete-btn">Delete</button>';
let id = 5;
let preventSet = false;

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            eventText: '',
            eventDesc: '',
            eventDate: [now, new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours() + 2)],
            controls: ['date', 'time'],
            dateWheels: '|D M d|',
            allDay: false,
            isFree: 'busy',
            events: [{
                id: 1,
                start: new Date(now.getFullYear(), now.getMonth(), 8, 13),
                end: new Date(now.getFullYear(), now.getMonth(), 8, 13, 30),
                text: 'Lunch @ Butcher\'s' + btn,
                color: '#26c57d'
            }, {
                id: 2,
                start: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 15),
                end: new Date(now.getFullYear(), now.getMonth(), now.getDate(), 16),
                text: 'General orientation' + btn,
                color: '#fd966a'
            }, {
                id: 3,
                start: new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1, 18),
                end: new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1, 22),
                text: 'Dexter BD' + btn,
                color: '#37bbe4'
            }, {
                id: 4,
                start: new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 10, 30),
                end: new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 11, 30),
                text: 'Stakeholder mtg.' + btn,
                color: '#d00f0f'
            }]
        };
    }
    
    textChange = (event) => {
        this.setState({
            eventText: event.target.value
        });
    }
    
    descChange = (event) => {
        this.setState({
            eventDesc: event.target.value
        });
    }
    
    allDayChange = (event) => {
        const checked = event.target.checked;
        this.setState({
            allDay: checked,
            controls: checked ? ['date'] : ['date', 'time'],
            dateWheels: checked ? 'MM dd yy' : '|D M d|'
        });
    }
    
    dateChange = (event, inst) => {
        this.setState({
            eventDate: inst.getVal()
        });
    }
    
    isFreeChange = (event) => {
        this.setState({
            isFree: event.target.value
        });
    }
    
    showAddEventPopup = () => {
        this.popup.instance.show();
    }
    
    addEvent = (event, inst) => {
        const state = this.state;
        const newItem = {
            id: id,
            start: state.eventDate[0],
            end: state.eventDate[1],
            text: (state.eventText || 'New Event') + btn,
            title: state.eventText || 'New Event',
            description: state.eventDesc,
            allDay: state.allDay,
            free: state.isFree === 'free'
        };
        this.setState(state => ({
            events: [...state.events, newItem]
        }));
  
        this.navigate(this.monthCal.instance, state.eventDate[0]);
    }
    
    onPageChange = (event, inst) => {
        const day = event.firstDay;
        
        preventSet = true;
        this.setState({
            eventDate: [day, new Date(day.getFullYear(), day.getMonth(), day.getDate(), day.getHours() + 2)]
        });
        this.navigate(this.monthCal.instance, day);
    }
    
    onEventSelect = (event, inst) => {
        if (event.domEvent.target.classList.contains('md-delete-btn')) {
            mobiscroll.confirm({,
                title: 'Confirm Deletion',
                message: 'Are you sure you want to delete this item?',
                okText: 'Delete',
                callback: (res) => {
                    if (res) {
                        //remove element by id
                        const events = this.state.events.slice(0);
                        const index = events.findIndex(item => item.id === event.event.id);

                        events.splice(index, 1);
                        this.setState({
                            events: events
                        });
                        
                        mobiscroll.toast({,
                            message: 'Deleted'
                        });
                    }
                }
            });
        }
    }

    onSetDate = (event) => {
        if (!preventSet && this.dayCal != undefined) {
            this.navigate(this.dayCal.instance, event.date);
        }
        preventSet = false;
    }

    navigate(inst, val) {
        if (inst) {
            inst.navigate(val);
        }
    }

    setMonthCal = (comp) => {
        this.monthCal = comp;
    }

    setDayCal = (comp) => {
        this.dayCal = comp;
    }

    setPopup = (comp) => {
        this.popup = comp;
    }

    setRange = (comp) => {
        this.range = comp;
    }

    render () {
        return (
            <div>
                <mobiscroll.Form>
                    <div className="mbsc-grid md-add-event-demo">
                        <div className="mbsc-row mbsc-no-padding">
                            <div className="mbsc-col-md-4 mbsc-col-12">
                                <mobiscroll.Eventcalendar
                                    ref={this.setMonthCal}
                                    display="inline"
                                    view={monthView}
                                    data={this.state.events}
                                    onSetDate={this.onSetDate}
                                />
                                <div className="mbsc-btn-group-block">
                                    <button type="button" onClick={this.showAddEventPopup}>Add New Event</button>
                                </div>
                            </div>
                            <div className="mbsc-col-md-8 mbsc-col-12 md-col-right">
                                <mobiscroll.Eventcalendar
                                    ref={this.setDayCal}
                                    display="inline"
                                    layout="liquid"
                                    view={dayView}
                                    data={this.state.events}
                                    onPageChange={this.onPageChange}
                                    onEventSelect={this.onEventSelect}
                                />
                            </div>
                        </div>
                    </div>
                </mobiscroll.Form>
                <mobiscroll.Popup
                    ref={this.setPopup}
                    display="center"
                    cssClass="mbsc-no-padding"
                    buttons={popupBtn}
                    headerText="Add new event"
                    onSet={this.addEvent}
                >
                    <mobiscroll.Form>
                        <mobiscroll.FormGroup>
                            <mobiscroll.Form.Label>
                                Title
                                <input value={this.state.eventText} onChange={this.textChange} />
                            </mobiscroll.Form.Label>
                            <mobiscroll.Textarea value={this.state.eventDesc} onChange={this.descChange}>
                                Description
                            </mobiscroll.Textarea>
                        </mobiscroll.FormGroup>
                        <mobiscroll.FormGroup>  
                            <mobiscroll.Switch value={this.state.allDay} onChange={this.allDayChange}>
                                All-day
                            </mobiscroll.Switch>
                                <mobiscroll.Form.Label>
                                    Starts
                                    <input id="startDate" />
                                </mobiscroll.Form.Label>
                                <mobiscroll.Form.Label>
                                    Ends
                                    <input id="endDate" />
                                </mobiscroll.Form.Label>
                                <mobiscroll.Range
                                    ref={this.setRange}
                                    type="hidden"
                                    controls={this.state.controls}
                                    dateWheels={this.state.dateWheels}
                                    startInput="#startDate"
                                    endInput="#endDate"
                                    tabs={false}
                                    responsive={respRange}
                                    value={this.state.eventDate}
                                    onSet={this.dateChange}
                                    showSelector={false}
                                />
                            <mobiscroll.Segmented name="group" value="false" checked={this.state.isFree === 'busy'} onChange={this.isFreeChange}>
                                Show as busy
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented name="group" value="true" checked={this.state.isFree === 'free'} onChange={this.isFreeChange}>
                                Show as free
                            </mobiscroll.Segmented>
                        </mobiscroll.FormGroup>
                    </mobiscroll.Form>
                </mobiscroll.Popup>
            </div>
        );
    }    
}

<div id="content"></div>
.md-add-event-demo {
    position: absolute;
    height: 100%;
}

.md-add-event-demo .mbsc-row {
    height: 100%;
}

.md-add-event-demo .md-col-right {
    overflow: auto;
    height: 100%;
    border-left: 1px solid #ccc;
}

.md-add-event-demo .md-delete-btn {
    margin: 0;
    position: absolute;
    right: 10px;
    top: 8px;
    z-index: 1;
    transition: background-color .3s ease-out;
}

.mbsc-material .md-add-event-demo .md-delete-btn {
    top: 6px;
}

.mbsc-windows .md-add-event-demo .md-delete-btn {
    top: 10px;
}

.md-add-event-demo .md-delete-btn.mbsc-btn-outline.mbsc-btn:not(:disabled):not(.mbsc-active):hover:hover {
    background: #f5504e;
    color: #fff;
}

.mbsc-rtl .md-add-event-demo .md-delete-btn {
    right: auto;
    left: 10px;
}

.md-add-event-popup {
    max-width: 400px;
}

Event Calendar - View/update event

Change demo
View/update event

This demo renders event data that it gets from an API, however you can update events. You can find and load the event by ID into a form and then pass it back to the calendar on Save. Edit the fields:

  • d or start & end - Defines the date and length of the event - Use the range picker
  • text - Defines the lable for the event, which can be anything from text to something more complex like HTML
  • color - Defines the color of the event - use the color picker
  • allDay - Sets if the event is an all-day event or not
  • everything else you would like - You can add any additional data that makes sense, like busy or location...

After you have the new data object ready with the event data you can pass it to the calendar. While the event calendar doesn't ship with a built-in form for adding/editing events, you can use the popup component along with inputs & fields to build the form you need.

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

const popupBtn = [
    'cancel',
    {
        text: 'Save',
        handler: 'set'
    }
];

const monthView = {
    calendar: { type: 'month' }
};
    
const dayView = {
    eventList: { type: 'day' }
};

const respRange = {
    large: {
        touchUi: false
    }
};

const editBtn = '<button type="button" class="mbsc-btn mbsc-btn-outline mbsc-btn-primary md-edit-btn">Edit</button>';
let preventSet = false;

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            eventToEdit: {},
            events: [],
            eventText: '',
            eventDesc: '',
            allDay: false,
            eventDate: [],
            isFree: 'busy',
            eventColor: '',
            controls: ['date', 'time'],
            dateWheels: '|D M d|'
        };

        mobiscroll.util.getJson('https://trial.mobiscroll.com/events-update/', (arr) => {
            for (let i = 0; i < arr.length; i++) {
                arr[i].text += editBtn;
            }
            this.setState({
                events: arr
            });
        }, 'jsonp');
    }

    textChange = (event) => {
        this.setState({
            eventText: event.target.value
        });
    }

    descChange = (event) => {
        this.setState({
            eventDesc: event.target.value
        });
    }

    allDayChange = (event) => {
        const checked = event.target.checked;
        this.setState({
            allDay: checked,
            controls: checked ? ['date'] : ['date', 'time'],
            dateWheels: checked ? 'MM dd yy' : '|D M d|'
        });
    }

    dateChange = (event, inst) => {
        this.setState({
            eventDate: inst.getVal()
        });
    }

    isFreeChange = (event) => {
        this.setState({
            isFree: event.target.value
        });
    }

    setColor = (event, inst) => {
        this.setState({
            eventColor: inst.getVal()
        });
    }

    saveChanges = (event, inst) => {
        const state = this.state;
        const events = state.events.slice(0);
        const index = events.findIndex(x => x.id === state.eventToEdit.id);

        const eventToSave = {
            ...events[index], 
            id: state.eventToEdit.id,
            text: state.eventText + editBtn,
            desc: state.eventDesc,
            color: state.eventColor,
            allDay: state.allDay,
            start: state.eventDate[0],
            end: state.eventDate[1],
            free: state.isFree === 'free'
        };
        events.splice(index, 1, eventToSave);
        this.setState({
            events: events
        });
    }

    onPageChange = (event, inst) => {
        preventSet = true;
        this.navigate(this.cal.instance, event.firstDay);
    }

    onEventSelect = (ev, inst) => {
        if (ev.domEvent.target.classList.contains('md-edit-btn')) {
            const event = ev.event;
            const oneDay = 1000 * 60 * 60 * 24;
            const diff = new Date(event.end).getTime() - new Date(event.start).getTime();
            const days = Math.round(Math.abs(diff) / oneDay);
            const allDay = event.allDay || days > 0;
            
            this.setState({
                eventToEdit: event,
                eventText: event.text.replace(editBtn, '') || '',
                eventDesc: event.desc || '',
                allDay: allDay,
                eventDate: [event.start, event.end],
                isFree: event.free ? 'free' : 'busy',
                eventColor: event.color,
                controls: allDay ? ['date'] : ['date', 'time'],
                dateWheels: allDay ? 'MM dd yy' : '|D M d|'
            });

            this.popup.instance.show();
        }
    }

    onSetDate = (event, inst) => {
        if (!preventSet && this.list != undefined) {
            this.navigate(this.list.instance, event.date);
        }
        preventSet = false;
    }

    navigate(inst, val) {
        if (inst) {
            inst.navigate(val);
        }
    }

    setCal = (comp) => {
        this.cal = comp;
    }
    
    setList = (comp) => {
        this.list = comp;
    }

    setPopup = (comp) => {
        this.popup = comp;
    }

    setRange = (comp) => {
        this.range = comp;
    }

    render() {
        return (
            <div>
                <mobiscroll.Form>
                    <div className="mbsc-grid md-view-update-demo">
                        <div className="mbsc-row mbsc-no-padding">
                            <div className="mbsc-col-md-4 mbsc-col-12">
                                <mobiscroll.Eventcalendar
                                    ref={this.setCal}
                                    display="inline"
                                    view={monthView}
                                    data={this.state.events}
                                    onSetDate={this.onSetDate}
                                />
                            </div>
                            <div className="mbsc-col-md-8 mbsc-col-12 md-col-right">
                                <mobiscroll.Eventcalendar
                                    ref={this.setList}
                                    display="inline"
                                    view={dayView}
                                    data={this.state.events}
                                    onPageChange={this.onPageChange}
                                    onEventSelect={this.onEventSelect}
                                />
                            </div>
                        </div>
                    </div>
                </mobiscroll.Form>
                <mobiscroll.Popup
                    ref={this.setPopup}
                    display="center"
                    buttons={popupBtn}
                    headerText="Edit event"
                    onSet={this.saveChanges}
                >
                    <mobiscroll.Form>
                        <mobiscroll.FormGroup>
                            <mobiscroll.Form.Label>
                                Title
                                <input value={this.state.eventText} onChange={this.textChange} />
                            </mobiscroll.Form.Label>
                            <mobiscroll.Textarea value={this.state.eventDesc} onChange={this.descChange}>
                                Description
                            </mobiscroll.Textarea>
                        </mobiscroll.FormGroup>
                        <mobiscroll.FormGroup className="md-hidden">  
                            <mobiscroll.Switch value={this.state.allDay} onChange={this.allDayChange}>
                                All-day
                            </mobiscroll.Switch>
                            <mobiscroll.Form.Label>
                                Starts
                                <input id="startDate" />
                            </mobiscroll.Form.Label>
                            <mobiscroll.Form.Label>
                                Ends
                                <input id="endDate" />
                            </mobiscroll.Form.Label>
                            <mobiscroll.Range
                                ref={this.setRange}
                                type="hidden"
                                controls={this.state.controls}
                                dateWheels={this.state.dateWheels}
                                startInput="#startDate"
                                endInput="#endDate"
                                tabs={false}
                                responsive={respRange}
                                value={this.state.eventDate}
                                onSet={this.dateChange}
                            />
                            <mobiscroll.Segmented name="group" value="busy" checked={this.state.isFree === 'busy'} onChange={this.isFreeChange}>
                                Show as busy
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented name="group" value="free" checked={this.state.isFree === 'free'} onChange={this.isFreeChange}>
                                Show as free
                            </mobiscroll.Segmented>
                            <mobiscroll.Color
                                type="hidden"
                                display="inline"
                                layout="liquid"
                                clear={false}
                                value={this.state.eventColor}
                                onSet={this.setColor}
                                data={["#fff568", "#ffc400", "#ff5252", "#f48fb1", "#ba68c8", "#8c9eff", "#90caf9", "#9ccc65", "#0db057", "#bcaaa4"]}
                            />
                        </mobiscroll.FormGroup>
                    </mobiscroll.Form>
                </mobiscroll.Popup>
            </div>
        );
    }    
}

<div id="content"></div>
.md-view-update-demo {
    position: absolute;
    height: 100%;
}

.md-view-update-demo .mbsc-row {
    height: 100%;
}

.md-view-update-demo .md-col-right {
    overflow: auto;
    height: 100%;
    border-left: 1px solid #ccc;
}

.md-view-update-popup {
    max-width: 400px;
}

.md-hidden .mbsc-color-input {
    display: none;
}

.md-view-update-demo .md-edit-btn {
    margin: 0;
    position: absolute;
    right: 10px;
    top: 8px;
    z-index: 1;
    transition: background-color .3s ease-out;
}

.mbsc-material .md-view-update-demo .md-edit-btn {
    top: 6px;
}

.mbsc-windows .md-view-update-demo .md-edit-btn {
    top: 10px;
}

.md-view-update-demo .md-edit-btn.mbsc-btn-outline.mbsc-btn:not(:disabled):not(.mbsc-active):hover:hover {
    background: #3f97f6;
    color: #fff;
}

.mbsc-rtl .md-view-update-demo .md-edit-btn {
    right: auto;
    left: 10px;
}

Event Calendar - Calendar systems

Change demo
Calendar systems

The event calendar supports multiple calendar systems. You can control it with the calendarSystem setting, and it supports the following options:

  • Gregorian - it is included by default
  • Jalali - it is the default system of the Persian calendar and is inlcuded within the Farsi language pack
  • Hijri - it is included in the Arabic language pack
Interested in localization?  Explore this example →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: []
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    render() {
        return (
            <mobiscroll.Form>
                <div className="mbsc-grid">
                    <div className="mbsc-row">
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Gregorian calendar</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    data={this.state.myEvents}
                                    calendarSystem="gregorian"
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Jalali calendar</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    data={this.state.myEvents}
                                    calendarSystem="jalali"
                                    lang="fa"
                                />
                            </mobiscroll.FormGroup>
                        </div>
                        <div className="mbsc-col-sm-12 mbsc-col-md-4">
                            <mobiscroll.FormGroup>
                                <mobiscroll.FormGroupTitle>Hijri calendar</mobiscroll.FormGroupTitle>
                                <mobiscroll.Eventcalendar
                                    display="inline"
                                    data={this.state.myEvents}
                                    calendarSystem="hijri"
                                    lang="ar"
                                />
                            </mobiscroll.FormGroup>
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }    
}

<div id="content"></div>

Event Calendar - Event handlers

Change demo
Event handlers

The event calendar ships with different hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code. While users interact with the UI events like onEventSelect, onInit, onLabelTap ... will be triggered. Interact with the example and check the event log for the output.

For a complete list of events go to the documentation  See available lifecycle events →
Clear event log
EVENTS FIRED: 
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

class App extends React.Component {
    constructor(props) {
        super(props);

        var now = new Date();
        
        this.state = {
            myEvents: [{
                d: now,
                text: 'Green box to post office',
                color: '#6e7f29'
            }, {
                d: 'w3',
                text: 'Employment (Semi-weekly)',
                color: '#635045'
            }, {
                d: 'w5',
                text: 'Employment (Semi-weekly)',
                color: '#ff9966'
            }, {
                start: new Date(now.getFullYear(), 1, 7),
                end: new Date(now.getFullYear(), 1, 25),
                text: 'Dean OFF',
                color: '#99ff33'
            }, {
                start: new Date(now.getFullYear(), 2, 5),
                end: new Date(now.getFullYear(), 2, 14),
                text: 'Mike OFF',
                color: '#e7b300'
            }, {
                start: new Date(now.getFullYear(), 4, 7),
                end: new Date(now.getFullYear(), 4, 16),
                text: 'John OFF',
                color: '#669900'
            }, {
                start: new Date(now.getFullYear(), 5, 1),
                end: new Date(now.getFullYear(), 5, 11),
                text: 'Carol OFF',
                color: '#6699ff'
            }, {
                start: new Date(now.getFullYear(), 6, 2),
                end: new Date(now.getFullYear(), 6, 17),
                text: 'Jason OFF',
                color: '#cc9900'
            }, {
                start: new Date(now.getFullYear(), 7, 6),
                end: new Date(now.getFullYear(), 7, 14),
                text: 'Ashley OFF',
                color: '#339966'
            }, {
                start: new Date(now.getFullYear(), 8, 10),
                end: new Date(now.getFullYear(), 8, 20),
                text: 'Marisol OFF',
                color: '#8701a9'
            }, {
                start: new Date(now.getFullYear(), 9, 1),
                end: new Date(now.getFullYear(), 9, 12),
                text: 'Sharon OFF',
                color: '#cc6699'
            }, {
                d: '12/25',
                text: 'Christmas Day',
                color: '#ff0066'
            }, {
                d: '1/1',
                text: 'New Year\'s day',
                color: '#99ccff'
            }, {
                d: '4/1',
                text: 'April Fool\'s Day',
                color: '#ff6666'
            }]
        };
    }

    onInit = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onMarkupReady = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onBeforeShow = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onPosition = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onShow = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onDestroy = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onClose = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onBeforeClose = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onPageLoading = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onPageLoaded = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onPageChange = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onEventSelect = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onDayChange = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onLabelTap = (event, inst) => {
        // Your custom event handler goes here
    }
    
    onSetDate = (event, inst) => {
        // Your custom event handler goes here
    }
    
    render() {
        return (
            <mobiscroll.Eventcalendar
                lang=""
                theme=""
                display="inline"
                view={{
                    calendar: { type: 'month' },
                    eventList: { type: 'month', scrollable: true }
                }}
                data={this.state.myEvents}
                onInit={this.onInit}
                onMarkupReady={this.onMarkupReady}
                onBeforeShow={this.onBeforeShow}
                onPosition={this.onPosition}
                onShow={this.onShow}
                onDestroy={this.onDestroy}
                onClose={this.onClose}
                onBeforeClose={this.onBeforeClose}
                onPageLoading={this.onPageLoading}
                onPageLoaded={this.onPageLoaded}
                onPageChange={this.onPageChange}
                onEventSelect={this.onEventSelect}
                onDayChange={this.onDayChange}
                onLabelTap={this.onLabelTap}
                onSetDate={this.onSetDate}
            />
        );
    }    
}

<div id="content" style="min-height:100%"></div>

Event Calendar - Localization

Change demo
Localization

The components are fully localized. In case of the event calendar this covers date and time format, button copy, rtl and more. You can see how each example shows up by clicking on the small flag icon or checking the examples below.

All settings can be manually overriden  See what options the localization impacts →
import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

class App extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            myEvents: [],
            lang: 'en',
            languages: [{
                value: 'en',
                text: 'English'
            }, {
                value: 'ar',
                text: 'Arabic'
            }, {
                value: 'bg',
                text: 'Bulgarian'
            }, {
                value: 'ca',
                text: 'Català'
            }, {
                value: 'cs',
                text: 'Cestina'
            }, {
                value: 'zh',
                text: 'Chinese'
            }, {
                value: 'hr',
                text: 'Croatian'
            }, {
                value: 'da',
                text: 'Dansk'
            }, {
                value: 'de',
                text: 'Deutsch'
            }, {
                value: 'en-UK',
                text: 'English (UK)'
            }, {
                value: 'es',
                text: 'Español'
            }, {
                value: 'fr',
                text: 'Français'
            }, {
                value: 'el',
                text: 'Greek'
            }, {
                value: 'in',
                text: 'Hindi'
            }, {
                value: 'it',
                text: 'Italiano'
            }, {
                value: 'ja',
                text: 'Japanese'
            }, {
                value: 'ko',
                text: 'Korean'
            }, {
                value: 'lt',
                text: 'Lietuvių'
            }, {
                value: 'hu',
                text: 'Magyar'
            }, {
                value: 'nl',
                text: 'Nederlands'
            }, {
                value: 'no',
                text: 'Norsk'
            }, {
                value: 'pl',
                text: 'Polski'
            }, {
                value: 'pt-PT',
                text: 'Português Europeu'
            }, {
                value: 'pt-BR',
                text: 'Pt. Brasileiro'
            }, {
                value: 'ro',
                text: 'Româna'
            }, {
                value: 'sr',
                text: 'Serbian'
            }, {
                value: 'sk',
                text: 'Slovencina'
            }, {
                value: 'fi',
                text: 'Suomi'
            }, {
                value: 'sv',
                text: 'Svenska'
            }, {
                value: 'th',
                text: 'Thai'
            }, {
                value: 'tr',
                text: 'Türkçe'
            }, {
                value: 'ua',
                text: 'Ukrainian'
            }, {
                value: 'vi',
                text: 'Vietnamese'
            }, {
                value: 'ru',
                text: 'Русский'
            }, {
                value: 'ru-UA',
                text: 'Русский (UA)'
            }, {
                value: 'he',
                text: 'עברית'
            }, {
                value: 'fa',
                text: 'فارسی'
            }]
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (events) => {
            this.setState({ myEvents: events});
        }, 'jsonp');
    }
    
    onSet = (event, inst) => {
        const la = inst.getVal();
        
        this.setState({
            lang: la
        });
    }
        
    render() {
        return (
            <mobiscroll.Form className="md-localization" inputStyle="box" labelStyle="inline">
                <div className="mbsc-grid">
                    <div className="mbsc-row mbsc-justify-content-center">
                        <div className="mbsc-col-sm-7 mbsc-col-md-5 mbsc-col-lg-4">
                            <label>
        					    <span className={'flag flag-' + this.state.lang}></span>
                                <mobiscroll.Select
                                    value={this.state.lang}
                                    data={this.state.languages}
                                    display="bubble"
                                    touchUi={false}
                                    onSet={this.onSet}
                                >
                                </mobiscroll.Select>
                            </label>
                        </div>
                    </div>
                    <div className="mbsc-row mbsc-justify-content-center">
                        <div className="mbsc-col-sm-9 mbsc-col-md-7 mbsc-col-lg-6">
                            <mobiscroll.Eventcalendar
                                lang={this.state.lang}
                                display="inline"
                                data={this.state.myEvents}
                            />
                        </div>
                    </div>
                </div>
            </mobiscroll.Form>
        );
    }    
}

<div id="content"></div>
.md-localization span.flag {
    min-width: 22px;
    height: 15px;
    position: relative;
    left: 0;
    margin-right: 1em;
    z-index: 1;
    top: 10px;
}

.mbsc-rtl .md-localization span.flag {
    margin-right: 0;
    margin-left: 1em;
}

.mbsc-ios .md-localization span.flag {
    top: 15px;
    left: 1em;
}

.mbsc-rtl.mbsc-ios .md-localization span.flag {
    right: 1em;
}

.mbsc-windows .md-localization span.flag {
    top: 8px;
}

.md-localization img.flag {
    width: 30px;
}

.md-localization .flag {
    background: url(https://img.mobiscroll.com/demos/flags/flags_responsive.png) no-repeat;
    background-size: 100%;
}

.md-localization .flag-en {
    background-position: 0 93.38843%;
}

.md-localization .flag-ar {
    background-position: 0 76.033058%;
}

.md-localization .flag-bg {
    background-position: 0 9.090909%;
}

.md-localization .flag-ca {
    background-position: 0 14.876033%;
}

.md-localization .flag-cs {
    background-position: 0 21.900826%;
}

.md-localization .flag-zh {
    background-position: 0 19.008264%;
}

.md-localization .flag-hr {
    background-position: 0 38.429752%;
}

.md-localization .flag-da {
    background-position: 0 23.140496%;
}

.md-localization .flag-de {
    background-position: 0 22.31405%;
}

.md-localization .flag-en-UK {
    background-position: 0 92.561983%;
}

.md-localization .flag-es {
    background-position: 0 26.859504%;
}

.md-localization .flag-fr {
    background-position: 0 29.752066%;
}

.md-localization .flag-el {
    background-position: 0 34.710744%;
}

.md-localization .flag-in {
    background-position: 0 40.909091%;
}

.md-localization .flag-it {
    background-position: 0 42.975207%;
}

.md-localization .flag-ja {
    background-position: 0 44.214876%;
}

.md-localization .flag-ko {
    background-position: 0 47.520661%;
}

.md-localization .flag-lt {
    background-position: 0 52.066116%;
}

.md-localization .flag-hu {
    background-position: 0 39.256198%;
}

.md-localization .flag-nl {
    background-position: 0 65.289256%;
}

.md-localization .flag-no {
    background-position: 0 65.702479%;
}

.md-localization .flag-pl {
    background-position: 0 70.661157%;
}

.md-localization .flag-pt-PT {
    background-position: 0 72.31405%;
}

.md-localization .flag-pt-BR {
    background-position: 0 11.983471%;
}

.md-localization .flag-ro {
    background-position: 0 74.380165%;
}

.md-localization .flag-sr {
    background-position: 0 74.793388%;
}

.md-localization .flag-sk {
    background-position: 0 79.752066%;
}

.md-localization .flag-fi {
    background-position: 0 27.68595%;
}

.md-localization .flag-sv {
    background-position: 0 77.68595%;
}

.md-localization .flag-th {
    background-position: 0 85.950413%;
}

.md-localization .flag-tr {
    background-position: 0 89.256198%;
}

.md-localization .flag-ua {
    background-position: 0 91.735537%;
}

.md-localization .flag-vi {
    background-position: 0 96.694215%;
}

.md-localization .flag-ru {
    background-position: 0 75.206612%;
}

.md-localization .flag-ru-UA {
    background-position: 0 10.743802%;
}

.md-localization .flag-he {
    background-position: 0 40.495868%;
}

.md-localization .flag-fa {
    background-position: 0 42.14876%;
}

Event Calendar - Theming capabilities

Change demo
Theming capabilities

The look and feel of the event calendar can be deeply customized. There are four levels of customization:

  • Base themes: Choose between Mobiscroll, iOS, Android Material and Windows.
  • Light or dark: Every theme has a light and dark variant.
  • Custom themes: Use the theme builder to customize the colors and make it match your brand.
  • Custom CSS: If you need further customization, the sky is the limit with CSS overrides.

You can also see how every example looks by changing the theme in the floating action bar on the right side.

import mobiscroll from '@mobiscroll/react';
import '@mobiscroll/react/dist/css/mobiscroll.min.css';

mobiscroll.settings = {
    lang: '',
    theme: ''
};

class App extends React.Component {
     constructor(props) {
        super(props);

        this.state = {
            ios: 'ios',
            material: 'material',
            windows: 'windows',
            mobiscroll: 'mobiscroll',
            events: [] 
        };
        
        mobiscroll.util.getJson('https://trial.mobiscroll.com/events/', (arr) => {
            this.setState({ events: arr});
        }, 'jsonp');
    }
    
    changeIos = (event) => {
        this.setState({ ios: event.target.value });
    }
    
    changeMaterial = (event) => {
        this.setState({ material: event.target.value });
    }
    
    changeWindows = (event) => {
        this.setState({ windows: event.target.value });
    }
    
    changeMobiscroll = (event) => {
        this.setState({ mobiscroll: event.target.value });
    }
    
    render () {
        return (
            <div className="mbsc-grid mbsc-grid-fixed">
                <div className="mbsc-row">
                    <mobiscroll.FormGroup className="mbsc-col-sm-12 mbsc-col-md-6">
                        <mobiscroll.Form>
                            <mobiscroll.FormGroupTitle>iOS Theme</mobiscroll.FormGroupTitle>
                            <mobiscroll.Segmented value="ios" name="ios" checked={this.state.ios === 'ios'} onChange={this.changeIos}>
                                Light
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="ios-dark" name="ios" checked={this.state.ios === 'ios-dark'} onChange={this.changeIos}>
                                Dark
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="ios-gray" name="ios" checked={this.state.ios === 'ios-gray'} onChange={this.changeIos}>
                                Custom
                            </mobiscroll.Segmented>
                        </mobiscroll.Form>
                        <mobiscroll.Eventcalendar
                            ref="iosCal"
                            theme={this.state.ios}
                            display="inline"
                            view={{
                                calendar: {
                                    labels: true
                                }
                            }}
                            data={this.state.events}
                        />
                    </mobiscroll.FormGroup>
                    <mobiscroll.FormGroup className="mbsc-col-sm-12 mbsc-col-md-6">
                        <mobiscroll.Form>
                            <mobiscroll.FormGroupTitle>Material Theme</mobiscroll.FormGroupTitle>
                            <mobiscroll.Segmented value="material" name="material" checked={this.state.material === 'material'} onChange={this.changeMaterial}>
                                Light
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="material-dark" name="material" checked={this.state.material === 'material-dark'} onChange={this.changeMaterial}>
                                Dark
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="material-indigo" name="material" checked={this.state.material === 'material-indigo'} onChange={this.changeMaterial}>
                                Custom
                            </mobiscroll.Segmented>
                        </mobiscroll.Form>
                        <mobiscroll.Eventcalendar
                            ref="materialCal"
                            theme={this.state.material}
                            display="inline"
                            view={{
                                calendar: {
                                    labels: true
                                }
                            }}
                            data={this.state.events}
                        />
                    </mobiscroll.FormGroup>
                </div>
                <div className="mbsc-row">
                    <mobiscroll.FormGroup className="mbsc-col-sm-12 mbsc-col-md-6">
                       <mobiscroll.Form>
                            <mobiscroll.FormGroupTitle>Windows Theme</mobiscroll.FormGroupTitle>
                            <mobiscroll.Segmented value="windows" name="windows" checked={this.state.windows === 'windows'} onChange={this.changeWindows}>
                                Light
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="windows-dark" name="windows" checked={this.state.windows === 'windows-dark'} onChange={this.changeWindows}>
                                Dark
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="windows-yellow" name="windows" checked={this.state.windows === 'windows-yellow'} onChange={this.changeWindows}>
                                Custom
                            </mobiscroll.Segmented>
                        </mobiscroll.Form>
                        <mobiscroll.Eventcalendar
                            ref="windowsCal"
                            theme={this.state.windows}
                            display="inline"
                            view={{
                                calendar: {
                                    labels: true
                                }
                            }}
                            data={this.state.events}
                        />
                    </mobiscroll.FormGroup>
                    <mobiscroll.FormGroup className="mbsc-col-sm-12 mbsc-col-md-6">
                        <mobiscroll.Form>
                            <mobiscroll.FormGroupTitle>Mobiscroll Theme</mobiscroll.FormGroupTitle>
                            <mobiscroll.Segmented value="mobiscroll" name="mobiscroll" checked={this.state.mobiscroll === 'mobiscroll'} onChange={this.changeMobiscroll}>
                                Light
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="mobiscroll-dark" name="mobiscroll" checked={this.state.mobiscroll === 'mobiscroll-dark'} onChange={this.changeMobiscroll}>
                                Dark
                            </mobiscroll.Segmented>
                            <mobiscroll.Segmented value="mobiscroll-lime" name="mobiscroll" checked={this.state.mobiscroll === 'mobiscroll-lime'} onChange={this.changeMobiscroll}>
                                Custom
                            </mobiscroll.Segmented>
                        </mobiscroll.Form>
                        <mobiscroll.Eventcalendar
                            ref="mobiscrollCal"
                            theme={this.state.mobiscroll}
                            display="inline"
                            view={{
                                calendar: {
                                    labels: true
                                }
                            }}
                            data={this.state.events}
                        />
                    </mobiscroll.FormGroup>
                </div>
            </div>
        );
    }    
}

<div id="content"></div>

Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.

Component license


Purchase component licenses if you are looking for specific funcionality.

Total


All features will be included with the license.

Buy component license

Framework license


Get all 36 components, including with the Framework license.



Mobiscroll for React $595


Use Javascript when building with plain and simple JS. Use jQuery when you have jQuery already included or if you are building with jQuery Mobile. Use AngularJS when building with Angular 1.x or Ionic 1. Use Angular when building with Angular 2/4/5/6/7/8 or Ionic 2/3/4. Use it when you are building your app or website with React.


Buy framework license
See other licensing options

Framework license


Get all 36 components, including with the Framework license.



Mobiscroll for React $595


  • Use it when building with plain and simple JS
  • Compatible with vanilla JS app or frameworks like Vue
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with jQuery and jQuery Mobile
  • Enjoy the familiar API if you already use jQuery
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular JS and Ionic 1
  • For web and mobile apps based on Angular 1.x
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular and Ionic 2/3/4
  • Visual Studio and VS Code integration
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it when building with React JS
  • Collection of UI components for web and mobile
  • Royalty-free commercial usage
  • Technical support is included with the license
Buy framework license
See other licensing options

Framework license


Select the development framework you are using. Get all 36 components with the license.

Mobiscroll for Javascript
Mobiscroll for jQuery
Mobiscroll for React
Mobiscroll for Angular
Mobiscroll for Angular JS
  • Use it when building with plain and simple JS
  • Compatible with vanilla JS app or frameworks like Vue
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with jQuery and jQuery Mobile
  • Enjoy the familiar API if you already use jQuery
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular JS and Ionic 1
  • For web and mobile apps based on Angular 1.x
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it with Angular and Ionic 2/3/4
  • Visual Studio and VS Code integration
  • Royalty-free commercial usage
  • Technical support is included with the license
  • Use it when building with React JS
  • Collection of UI components for web and mobile
  • Royalty-free commercial usage
  • Technical support is included with the license
Buy framework license
See other licensing options

Select the framework you are interested in

Javascript
jQuery
Angular
Angular JS
React

Use Javascript when building with plain and simple JS.

Use jQuery when you have jQuery already included or if you are building with jQuery Mobile.

Use AngularJS when building with Angular 1.x or Ionic 1.

Use Angular when building with Angular 2/4/5/6/7/8 or Ionic 2/3/4.

Use it when you are building your app or website with React.

Do you need additional support seats?

The license comes with one support seat. ( +$50/seat )

Add the source code?

Price
Buy now
Customize & try demos locally
Sign in or start your free trial

What framework are you using?

Javascript
jQuery
AngularJS
Angular
Ionic
React
Other
Select a framework
Email address

Customize & try this demo locally
Sign in or start your free trial

We have to set you up with a trial for this to run 👍

Email address

Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Ionic project

Copy command
$ mobiscroll config ionic
$ mobiscroll config ionic --lite

You will be prompted to log in with your mobiscroll account. Set your password here

Create an Ionic 3 & Mobiscroll starter with the CLI:

$ mobiscroll start ionic myStarter

Run this command for Ionic 4 & Mobiscroll starter:

$ mobiscroll start ionic-angular myStarter

Step 3.Copy the code into your app.

Copy TS
Copy HTML
Copy CSS
Copy Module

Step 4.Run ionic serve in the root folder of your app 🎉

Copy command
$ ionic serve

And voilà, everything should be running smoothly.

Customize & try demos locally
How would you like to do it?
Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Angular project

Copy command
$ mobiscroll config angular
$ mobiscroll config angular --lite

You will be prompted to log in with your mobiscroll account. Set your password here

Step 3.Copy the code into your app. HTML goes into the markup, TS into Typescript.

Copy TS
Copy HTML
Copy CSS
Copy Module

Step 4.Run ng serve in the root folder of your app 🎉

Copy command
$ ng serve

And voilà, everything should be running smoothly.

Thanks for downloading
Try and customize the app locally

Extract the zip file and run the project like any Ionic app. Make sure to have Ionic CLI installed and open the terminal in the app root folder.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ionic serve

Let us know if we can help and enjoy!

Change your password
Need to update your password? Enter and hit the button below

You are setting a password for the account

New Password Required Enter at least 6 characters
Change your password
Need to update your password? Enter and hit the button below

Your password has been changed!

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

Extract the zip file and open the demo in your favorite browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

Please extract the zip file and run the project like any Angular CLI app. Make sure to have the Angular CLI installed.

For installation and usage, extract the zip file and open a terminal window and follow these steps.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ng serve --open

Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

The easiest way to get started is to follow the installation steps and by grabbing the code directly from the demo page. Let us know if we can help and enjoy!

You'll find a fully functional Kitchen-sink Ionic app in the zip file.

Thanks for downloading
Customize demos locally

Everything is set up so that you can dig in right away and start exploring.

We have set up a trial so that you can try the demos locally.

The demos are using Babel's in-browser ES6 and JSX transformer. Extract the zip file and open the demo in your browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

Demos
Alerts & notifications
Alert Notifications Note
Components
Alerts & notifications 3
Buttons 4
Calendar 27
Cards 14
Collapsible 3
Color 10
Date & Time 20
Event Calendar 25
Forms 6
Grid layout 7
Image 7
Inputs & fields 6
Listview 18
Measurement 10
Navigation 8
Number 8
Numpad 13
Option List 4
Popup 10
Range 19
Scroller 7
Scrollview 5
Select 18
Slider & progress 4
Styling 6
Timer 5
Timespan 6
Toggle & Radio 4
Treelist 7
Theme Select
Mobiscroll
Mobiscroll Dark
Material
Material Dark
iOS
iOS Dark
Bootstrap
Windows
Windows Dark
Display Mode
Language Locale
See other demos and change options
Theme
Display
Locale
See other demos