Giter Site home page Giter Site logo

davidalekna / react-organizer Goto Github PK

View Code? Open in Web Editor NEW
31.0 1.0 1.0 1.16 MB

๐Ÿ“… Primitive to build simple, flexible, enhanced dates, calendars, events React components

Home Page: https://davidalekna.github.io/react-organizer

License: MIT License

JavaScript 93.16% TypeScript 6.84%
calendar datepicker events daypicker dates

react-organizer's Introduction

Organizer ๐Ÿ“… (beta)

Primitive to build simple, flexible, enhanced dates, calendars, input slector, events manager React components


Build Status Code Coverage MIT License PRs Welcome Code of Conduct size gzip size Storybook

The problem

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 solution

This is a render props component that provides functionality and state management to create your own styled components.

Table of Contents

Installation

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 and prop-types. Please make sure you have those installed as well.

Usage

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.

Try it out in the browser

import React from 'react'
import {render} from 'react-dom'
import Organizer from 'react-organizer'

render(
  <Organizer>
    {(props) => (
      <div />
    )}
  </Organizer>,
  document.getElementById('root'),
)

Props

This is the list of props that you should know about.

days

array | optional

array of week day names in prefered language. Defaults to english.

months

array | optional

array of month names in prefered language. Defaults to english.

date

date | optional

calendar date state

selected

date | optional

selected date state

getPrevMonthOffset

function({month: number, year: number, events: boolean})

generates previews month offset

getNextMonthOffset

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

getCurrentMonth

function({month: number, year: number, events: boolean})

generates current month

getFullMonth

function(initMonth: number, events: boolean)

generates full month with previews and next months offset days

getFullYear

function(events: boolean)

generates full year with months with previews and next months offset days

addCalendarMonth

function()

subCalendarMonth

function()

addCalendarYear

function()

subCalendarYear

function()

selectDate

function({date: object})

selects date and adds a flag of selected on day object

selectRange

function({date: object})

selected state holds an array and will allow 2 dates in it

reset

function()

resets calendar to initial state

selectMonth

function({month: number})

selectYear

function({year: number})

changeLanguage

function({days: array, months: array})

change language state

children

function({}) | required

This is called with an object.

LICENSE

MIT

react-organizer's People

Contributors

davidalekna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

thestudentroom

react-organizer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.