2.0.4 • Published 3 months ago

@viniarruda/react-month-range-picker v2.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

react-month-range-picker

React component that can select an range of months separated by year

Install in your project

You can find more information in npm

yarn add @viniarruda/react-month-range-picker
or
npm i @viniarruda/react-month-range-picker

Demo here

Examples

default

two columns

Run

To run that demo on your own computer:

Clone this repository
yarn install
yarn storybook
Visit http://localhost:6006/

Props

PropstypedefaultValueInfo
columns1 or 21Columns to show
initialYearnumber2020The first initialYear
localestringen-USex: en-US
onRangeSelectfunctionrequiredPass an function to get the RangeParams
calendarClassnamestringoptionalPass an className to style calendar container
headerClassnamestringoptionalPass an className to style calendar header
monthClassnamestringoptionalPass an className to style month item

Styling

To control the month styles, you can use monthClassName="month" and this name will increment to variant month.

Soo, you can control the styles using:

.month_start .month_selected .month_end

onRangeSelect: (params: RangeParams) => void

type RangeParams = {
  startMonth: number
  startYear: number
  endMonth: number
  endYear: number
}
2.0.3

3 months ago

2.0.4

3 months ago

2.0.2

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago