npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alekna/react-organizer

v1.1.16

Published

Organizer is a lightweight, fast and extendable render props component

Downloads

26

Readme

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