react-barebones-calendar
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.2 • Public • Published

    react-barebones-calendar

    A simple fully customizable calendar for react.

    react-barebones-calendar demo-gif

    Getting Started

    Installation

    npm install --save react-barebones-calendar moment

    Run Demo

    To view the demos on a web page go to https://GeorgeVaughan.github.io/react-barebones-calendar

    To run the demo on your computer:

    Examples

    View all the example code in src/examples/

    The basic example is shown along with the code below:

    react-barebones-calendar demo-png

    class BasicCalendar extends Component<any, any> {
      constructor(props) {
        super(props);
    
        this.state = {
          monthMoments: getMonthsFrom(moment(), 1),
          selectedDay: moment()
        };
      }
      render() {
        const { monthMoments, selectedDay } = this.state;
        return (
          <Calendar
            monthGridProps={{
              monthMoments
            }}
            dayProps={{
              modifiers: [
                selectedModifier(selectedDay),
                emptyModifier,
                weekendModifier
              ],
              onClick: (_, { dayMoment }) =>
                this.setState({ selectedDay: dayMoment })
            }}
          />
        );
      }
    }

    There are also more complex examples like the large calendar displayed below:

    react-barebones-calendar large-demo-png

    The example code is available at src/examples/

    Install

    npm i react-barebones-calendar

    DownloadsWeekly Downloads

    6

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    178 kB

    Total Files

    40

    Last publish

    Collaborators

    • georgevaughan