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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jjunyjjuny/react-calendar

v1.2.3

Published

calendar component in React with TypeScript and JavaScript

Readme

📅 react-calendar

  • calendar component in React
  • you can use this component in JavaScript or TypeScript

🔲Sample

click

🚀 Installation

Using npm :

$ npm i @jjunyjjuny/react-calendar

Usage with styled-components

with TypeScript

import { useState } from "react";
import styled, { css } from "styled-components";
import Calendar, { OnClickResult, Controller } from "./calendar/Calendar";

export default function Sample() {
  const [target, setTarget] = useState("start");

  const onClickDay = (result: OnClickResult) => {
    setTarget(result.nextClickTarget);
  };

  return (
    <TestWrapper>
      <ControllerContainer>
        <Controller start>
          <Button
            isNext={target === "start"}
            onClick={() => {
              setTarget("start");
            }}
          >
            checkIn
          </Button>
        </Controller>
        <Controller end>
          <Button
            isNext={target === "end"}
            onClick={() => {
              setTarget("end");
            }}
          >
            checkOut
          </Button>
        </Controller>
      </ControllerContainer>
      <Calendar onClickDay={onClickDay} countOfMonth={2} />
    </TestWrapper>
  );
}

const TestWrapper = styled.div`
  width: 800px;
  margin: 150px auto;
  padding: 1rem;
  border-radius: 3rem;
  border: 1px solid black;
`;

const ControllerContainer = styled.div`
  width: 30%;
  display: flex;
  justify-content: space-around;
  margin: 0 auto;
`;

const Button = styled.div<{ isNext: boolean }>`
  height: 2rem;
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  ${({ isNext }) =>
    isNext &&
    css`
      background: #21618b;
      color: white;
    `};
  & + & {
    margin-left: 2rem;
  }
`;

📃 props

Calendar

| Name | Type | Description | | :----------: | :------: | :-------------------------------------------------------: | | onClickDay | function | Callback function to be executed when the date is clicked | | countOfMonth | number | Number of months to show at one time | | lang | string | select calendar language 'en' or 'ko'. defualt is 'en' |

About onClcikDay

  • This function receives an object called "result".
  • The "result" object contains information about the date you clicked on.
// example "result"
{
  clickedType: string,
  nextClickTarget: string,
  startDate: {
    year : number,
    month : number,
    day : number
    week: string
  },
  endDate: {
    year : number,
    month : number,
    day : number,
    week: string,
  },
}

| Name | Type | Description | | :----------------: | :----: | :--------------------------------------------------: | | clickedType | string | Date Type you clicked (start or end) | | nextClickTarget | string | Next Date Type you click (start, end) | | startDate, endDate | object | Date infomation you clicked (year, month, day, week) |

  • All you need to do is create a function that takes this "result" object and runs it and passes it to the onClickDay function of the Calendar component!
  • Check out the Sample

Controller

| Name | Value | Description | | :--------: | :-----: | :-------------------------------: | | start, end | boolean | Type of date to click in calendar |

Wait is Controller?

  • Controller is a wrapper that allows you to specify if the date to be clicked is start or end

  • you can create checkIn, checkOut button by using this.

  • check sample code!