Skip to content

simonwilbert/react-events-timetable

Repository files navigation

react-events-timetable

Story Book

Usage

  • Install the package yarn add react-events-timetable

  • Import the component where you want it import { Timetable } from "react-events-timetable";

  • Have handy an array of events

        const events = [
          { 
            name: "Event 1",
            description: "Description 1",
            sessions: [
              {
                from: new Date(...),
                to: new Date(...),
              },
              {
                from: new Date(...),
                to: new Date(...),
              },
            ],
            tags: [
              {
                name: "Tag 1",
                type: TAG_LOCATION_TYPE | TAG_ACTIVITY_TYPE | TAG_AGE_TYPE
              }
            ],
            venue: {
              name: "Venue 1"
            },
        ];
    
  • Use where you want it to render

      <Timetable
        from={new Date()}
        to={new Date()}
        tags=[{ name: "Tag 1"}, ...]
        events
        groupedBy: "LOCATIONTYPE" | "AGETYPE" | "ACTIVITYTYPE"
      />
    
    image