React Calendar Custom Day Cells

Add custom content to the day cells of the calendar. This can be dynamic content based on the date like an activity tracker that uses daily move data from an array of records.

Use the renderDayContent function to return custom markup that will be used when the day cells are being rendered.

Get started with this example

Demo

Loading the live demo

Preview in full screen

Code

import { Datepicker, setOptions  } from '@mobiscroll/react';

setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
});

const activities = [
  {
    date: '2026-10-30T00:00',
    move: 200,
    exercise: 360,
    stand: 180,
  },
  {
    date: '2026-10-31T00:00',
    move: 360,
    exercise: 150,
    stand: 230,
  },
  {
    date: '2026-11-01T00:00',
    move: 180,
    exercise: 200,
    stand: 280,
  },
  {
    date: '2026-11-02T00:00',
    move: 120,
    exercise: 150,
    stand: 200,
  },
  {
    date: '2026-11-03T00:00',
    move: 320,
    exercise: 180,
    stand: 100,
  },
  {
    date: '2026-11-04T00:00',
    move: 120,
    exercise: 100,
    stand: 200,
  },
  {
    date: '2026-11-05T00:00',
    move: 230,
    exercise: 170,
    stand: 330,
  },
  {
    date: '2026-11-06T00:00',
    move: 320,
    exercise: 260,
    stand: 80,
  },
  {
    date: '2026-11-07T00:00',
    move: 200,
    exercise: 140,
    stand: 180,
  },
  {
    date: '2026-11-08T00:00',
    move: 360,
    exercise: 300,
    stand: 160,
  },
  {
    date: '2026-11-09T00:00',
    move: 80,
    exercise: 360,
    stand: 360,
  },
  {
    date: '2026-11-10T00:00',
    move: 220,
    exercise: 170,
    stand: 290,
  },
  {
    date: '2026-11-11T00:00',
    move: 120,
    exercise: 40,
    stand: 100,
  },
  {
    date: '2026-11-12T00:00',
    move: 120,
    exercise: 200,
    stand: 80,
  },
];

function App() {
  const getDeg = (nr) => ({
    rotate1: nr > 180 ? 180 : nr,
    rotate2: nr > 180 ? nr - 180 : 0,
  });

  const getTransform = (rotate) => 'rotateZ(' + rotate + 'deg)';

  const customDay = (args) => {
    const a = activities.find((obj) => +new Date(obj.date) === +args.date);

    return (
      <div className="screen">
        <div className={a ? 'dial move' : ''}>
          <div className="dial-background" style={{ background: a ? '#752a2a' : '' }}></div>
          <div className="dial-container container1">
            <div className="wedge" style={{ transform: a ? getTransform(getDeg(a.move).rotate1) : '' }}></div>
          </div>
          <div className="dial-container container2">
            <div className="wedge" style={{ transform: a ? getTransform(getDeg(a.move).rotate2) : '' }}></div>
          </div>
          <div className="marker start"></div>
          <div className="marker end" style={{ transform: a ? getTransform(a.move) : '' }}></div>
        </div>
        <div className={a ? 'dial exercise' : ''}>
          <div className="dial-background" style={{ background: a ? '#4a6915' : '' }}></div>
          <div className="dial-container container1">
            <div className="wedge" style={{ transform: a ? getTransform(getDeg(a.exercise).rotate1) : '' }}></div>
          </div>
          <div className="dial-container container2">
            <div className="wedge" style={{ transform: a ? getTransform(getDeg(a.exercise).rotate2) : '' }}></div>
          </div>
          <div className="marker start"></div>
          <div className="marker end" style={{ transform: a ? getTransform(a.exercise) : '' }}></div>
        </div>
        <div className={a ? 'dial stand' : ''}>
          <div className="dial-background" style={{ background: a ? '#157b76' : '' }}></div>
          <div className="dial-container container1">
            <div className="wedge" style={{ transform: a ? getTransform(getDeg(a.stand).rotate1) : '' }}></div>
          </div>
          <div className="dial-container container2">
            <div className="wedge" style={{ transform: a ? getTransform(getDeg(a.stand).rotate2) : '' }}></div>
          </div>
          <div className="marker start"></div>
          <div className="marker end" style={{ transform: a ? getTransform(a.stand) : '' }}></div>
        </div>
      </div>
    );
  };

  return (
    <div>
      <Datepicker controls={['calendar']} touchUi={true} display="inline" renderDayContent={customDay} />
    </div>
  );
}

export default App;

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.