Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simple, modern and customizable month picker component for ReactJS.

License

NotificationsYou must be signed in to change notification settings

henripar/react-lite-month-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://img.shields.io/npm/dw/react-lite-month-pickernpmGitHub top languageGitHub

Simple, modern and customizable month picker component for ReactJS.

React Lite Month Picker

Features

😀Simple and easy to use.
🌶Tiny: Minzipped size less than 1kB.
🧁Highly customizable: Easily make it fit to your designs.
📅Accessible: Fully accessible with keyboard navigation. Developed according the WCAG 2.1 accesibility guidelines.
🇫🇮41 languages supported.
🚫0 Dependencies: No surprise dependencies included.

Installation

Using npm:

npm install react-lite-month-picker --save

Using yarn:

yarn add react-lite-month-picker

Using bun:

bun install react-lite-month-picker

Usage

import{useState}from'react';import{MonthPicker,MonthInput}from'react-lite-month-picker';functionExample(){const[selectedMonthData,setSelectedMonthData]=useState({month:9,year:2023,});const[isPickerOpen,setIsPickerOpen]=useState(false);return(<><div><MonthInputselected={selectedMonthData}setShowMonthPicker={setIsPickerOpen}showMonthPicker={isPickerOpen}/>{isPickerOpen ?(<MonthPickersetIsOpen={setIsPickerOpen}selected={selectedMonthData}onChange={setSelectedMonthData}/>) :null}</div></>);}exportdefaultExample;

Selected month data

Currently selected month data is an object with the following structure:

{month:9,year:2023,monthName:'September',monthShort:'Sep'}

It will get saved on set parent component state withonChange event.

Customization

You can customize theMonthPicker component styles by passing props to it.

Prop nameDescriptionDefault value
bgColorMonthActiveBackground color of the active month.#4ea3983e
bgColorMonthHoverBackground color of the month on mouse hover.#f4f4f4
borderRadiusMonthBorder radius of the moth element.7px
bgColorPickerBackground color of the picker element.#fff
textColorColor of the text.#000
sizeSize of the component. Accepts 'small' or 'large'.large
langLanguage. Accepts ISO 639-1 language code.en



You can customize theMonthInput component styles by passing props to it.

Prop nameDescriptionDefault value
bgColorBackground color of the input element.#fff
bgColorHoverBackground color of the input element on mouse hover.#fff
textColorColor of the text.#000
sizeSize of the component. Accepts 'small' or 'large'.large
langLanguage. Accepts ISO 639-1 language code.en

See full list of supported languages on thewebsite.

License

MIT ©henripar

About

Simple, modern and customizable month picker component for ReactJS.

Topics

Resources

License

Stars

Watchers

Forks

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp