• Stars
    star
    7,846
  • Rank 4,818 (Top 0.1 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

gcal/outlook like calendar component

react-big-calendar

An events calendar component built for React and made for modern browsers (read: not IE) and uses flexbox over the classic tables-caption approach.

Big Calendar Demo Image

DEMO and Docs

Inspired by Full Calendar.

Use and Setup

yarn add react-big-calendar or npm install --save react-big-calendar

Include react-big-calendar/lib/css/react-big-calendar.css for styles, and make sure your calendar's container element has a height, or the calendar won't be visible. To provide your own custom styling, see the Custom Styling topic.

Starters

Run examples locally

$ git clone [email protected]:jquense/react-big-calendar.git
$ cd react-big-calendar
$ yarn
$ yarn storybook

Localization and Date Formatting

react-big-calendar includes four options for handling the date formatting and culture localization, depending on your preference of DateTime libraries. You can use either the Moment.js, Globalize.js, date-fns, Day.js localizers.

Regardless of your choice, you must choose a localizer to use this library:

Moment.js

import { Calendar, momentLocalizer } from 'react-big-calendar'
import moment from 'moment'

const localizer = momentLocalizer(moment)

const MyCalendar = (props) => (
  <div>
    <Calendar
      localizer={localizer}
      events={myEventsList}
      startAccessor="start"
      endAccessor="end"
      style={{ height: 500 }}
    />
  </div>
)

Globalize.js v0.1.1

import { Calendar, globalizeLocalizer } from 'react-big-calendar'
import globalize from 'globalize'

const localizer = globalizeLocalizer(globalize)

const MyCalendar = (props) => (
  <div>
    <Calendar
      localizer={localizer}
      events={myEventsList}
      startAccessor="start"
      endAccessor="end"
      style={{ height: 500 }}
    />
  </div>
)

date-fns v2

import { Calendar, dateFnsLocalizer } from 'react-big-calendar'
import format from 'date-fns/format'
import parse from 'date-fns/parse'
import startOfWeek from 'date-fns/startOfWeek'
import getDay from 'date-fns/getDay'
import enUS from 'date-fns/locale/en-US'

const locales = {
  'en-US': enUS,
}

const localizer = dateFnsLocalizer({
  format,
  parse,
  startOfWeek,
  getDay,
  locales,
})

const MyCalendar = (props) => (
  <div>
    <Calendar
      localizer={localizer}
      events={myEventsList}
      startAccessor="start"
      endAccessor="end"
      style={{ height: 500 }}
    />
  </div>
)

Day.js

Note that the dayjsLocalizer extends Day.js with the following plugins:

import { Calendar, dayjsLocalizer } from 'react-big-calendar'
import dayjs from 'dayjs'

const localizer = dayjsLocalizer(dayjs)

const MyCalendar = (props) => (
  <div>
    <Calendar
      localizer={localizer}
      events={myEventsList}
      startAccessor="start"
      endAccessor="end"
      style={{ height: 500 }}
    />
  </div>
)

Custom Styling

Out of the box, you can include the compiled CSS files and be up and running. But, sometimes, you may want to style Big Calendar to match your application styling. For this reason, SASS files are included with Big Calendar.

  @import 'react-big-calendar/lib/sass/styles';
  @import 'react-big-calendar/lib/addons/dragAndDrop/styles'; // if using DnD

SASS implementation provides a variables file containing color and sizing variables that you can update to fit your application. Note: Changing and/or overriding styles can cause rendering issues with your Big Calendar. Carefully test each change accordingly.

Join The Community

Help us improve Big Calendar! Join us on Slack.

More Repositories

1

yup

Dead simple Object schema validation
TypeScript
21,194
star
2

react-widgets

Polished, feature rich, accessible form inputs built with React
TypeScript
2,318
star
3

react-formal

Sophisticated HTML form management for React
TypeScript
528
star
4

teaspoon

A jQuery like API for testing React elements and rendered components.
JavaScript
388
star
5

react-dom-lite

Tiny dom implementation using react-reconciler
JavaScript
246
star
6

uncontrollable

Wrap a controlled react component, to allow specific prop/handler pairs to be uncontrolled
TypeScript
194
star
7

react-bootstrap-modal

React port of jschr's better bootstrap modals
JavaScript
89
star
8

jarle

Just Another React Live Editor
JavaScript
65
star
9

topeka

Idiomatic, "two-way" bindings, in React.
TypeScript
56
star
10

date-math

simple date math module
JavaScript
53
star
11

bill

css selector engine for React elements and components
JavaScript
53
star
12

react-layer

Simple abstraction for creating and managing new render trees
JavaScript
44
star
13

react-input-message

A small, completely unopinionated way, to display messages next to inputs based on events. Helpful for displaying input validation messages
JavaScript
42
star
14

docusaurus-theme-tailwind

TailwindCSS based Docusaurus theme
TypeScript
29
star
15

webpack-atoms

Small atomic bits for crafting webpack configs
TypeScript
25
star
16

react-component-metadata

JavaScript
21
star
17

expr

tiny util for getting and setting deep object props safely
JavaScript
20
star
18

babel-plugin-jsx-fragment

jsx syntatic sugar for React's `createFragment()`
JavaScript
16
star
19

mp4-info-parser

JavaScript
12
star
20

sass-tailwind-functions

Sass plugin implementing TailwindCSS functions
JavaScript
11
star
21

react-dialog

programtic replacements for Alert and Confirm in React
JavaScript
9
star
22

babel-preset-jason

JavaScript
9
star
23

node-stream-tokenizr

fluent streaming binary parser for working buffer chunks, strings, and byte words
JavaScript
7
star
24

react-formal-inputs

a react-widgets adaptor for react-formal
JavaScript
7
star
25

webpack-config-utils

experiments in webpack config building
JavaScript
7
star
26

babel-preset-env-modules

JavaScript
6
star
27

markdown-jsx-loader

JavaScript
6
star
28

component-metadata-loader

webpack loader to parse React component metadata from source code
JavaScript
5
star
29

mpeg-frame-parser

JavaScript
5
star
30

mini-storybook

no frills story book for components
JavaScript
5
star
31

ogg-info-parser

small streaming .ogg parser for Node.js
JavaScript
5
star
32

tiny-case

JavaScript
4
star
33

vorbis-info-parser

Small parser for Vorbis Bit streams
JavaScript
4
star
34

docpocalypse

TypeScript
4
star
35

vscode-hrx

Syntax Grammar for HRX files
JavaScript
4
star
36

css-module-loader

JavaScript
4
star
37

ID3v2-info-parser

ID3 tag version 2 streaming parser
JavaScript
4
star
38

chain-function

chain a bunch of functions
JavaScript
4
star
39

react-clonewithprops

Stand-alone React cloneWithProps util that works with multiple versions of React
JavaScript
3
star
40

flac-info-parser

JavaScript
3
star
41

node-audio-info

JavaScript
2
star
42

browser-test-pages

2
star
43

react-component-managers

utilities for composing functionality into react-components, alt-mixin
JavaScript
2
star
44

mtag

mp3 Tagging and Batch Altering Scripts
Python
2
star
45

ID3v1-info-parser

JavaScript
2
star
46

scoped-warning

Creates a scoped warning() error for tracking who is throwing what
JavaScript
2
star
47

tiny-set-immediate

Modern polyfill for set immediate
TypeScript
2
star
48

match-resource-repro

JavaScript
2
star
49

react-tackle-box

JavaScript
2
star
50

node-ktc

Pre-compiler for Kendo UI Core templates
JavaScript
2
star
51

asf-info-parser

JavaScript
2
star
52

StringUtils

Common string utilities
C#
1
star
53

style-convert-macro

Convert CSS strings to CSS object styles
JavaScript
1
star
54

babel-plugin-external-helpers

insert require for babel helpers
JavaScript
1
star
55

astonish

JavaScript
1
star
56

sound-bytes

JavaScript
1
star
57

oauthenticity

JavaScript
1
star
58

test-publish-actions

JavaScript
1
star
59

cobble

tiny object js object model for doing compositional inheritance
JavaScript
1
star
60

node-simple-chainable

A small node module for queuing a series of functions that follow from each other
JavaScript
1
star
61

svelte-combobox

Created with CodeSandbox
Svelte
1
star
62

kwik-e-mart

pub/sub and datastore
JavaScript
1
star
63

babel-plugin-globalize

Extract formatters and messages from source code
JavaScript
1
star
64

webpack-pitch-repro

JavaScript
1
star