Primitive to build simple, flexible, enhanced dates, calendars, input slector, events manager React components
You need a calendar, events manager, date picker, range picker experience in your application and you want it to be accessible. You also want it to be simple and flexible to account for your use cases.
This is a render props component that provides functionality and state management to create your own styled components.
This module is distributed via npm which is bundled with node and
should be installed as one of your project's dependencies
:
npm install --save react-organizer
This package also depends on
react
andprop-types
. Please make sure you have those installed as well.
NOTE: Organizer component will not provide any styles or jsx, only the functionality. Styles used in the examples are only for better visualization for what could be achieved using this component.
import React from 'react'
import {render} from 'react-dom'
import Organizer from 'react-organizer'
render(
<Organizer>
{(props) => (
<div />
)}
</Organizer>,
document.getElementById('root'),
)
This is the list of props that you should know about.
array
| optional
array of week day names in prefered language. Defaults to english.
array
| optional
array of month names in prefered language. Defaults to english.
date
| optional
calendar date state
date
| optional
selected date state
function({month: number, year: number, events: boolean})
generates previews month offset
function({month: number, year: number, events: boolean, totalOffsetDays: number, totalDays: number})
generates next month offset depending on how many grid items you want to display, defaults to 42
function({month: number, year: number, events: boolean})
generates current month
function(initMonth: number, events: boolean)
generates full month with previews and next months offset days
function(events: boolean)
generates full year with months with previews and next months offset days
function()
function()
function()
function()
function({date: object})
selects date and adds a flag of selected on day object
function({date: object})
selected state holds an array and will allow 2 dates in it
function()
resets calendar to initial state
function({month: number})
function({year: number})
function({days: array, months: array})
change language state
function({})
| required
This is called with an object.
MIT