4.5.0 • Published 2 days ago

rc-picker v4.5.0

Weekly downloads
385,114
License
MIT
Repository
github
Last release
2 days ago

rc-picker

NPM version build status Codecov npm download bundle size

Live Demo

https://react-component.github.io/picker/

Install

rc-picker

Usage

import Picker from 'rc-picker';
import 'rc-picker/assets/index.css';
import { render } from 'react-dom';

render(<Picker />, mountNode);

API

Picker

PropertyTypeDefaultDescription
prefixClsStringrc-pickerprefixCls of this component
classNameString''additional css class of root dom node
styleReact.CSSPropertiesadditional style of root dom node
dropdownClassNameString''additional className applied to dropdown
dropdownAlignObject:alignConfig of dom-alignvalue will be merged into placement's dropdownAlign config
popupStyleReact.CSSPropertiescustomize popup style
transitionNameString''css class for animation
localeObjectimport from 'rc-picker/lib/locale/en_US'rc-picker locale
inputReadOnlybooleanfalseset input to read only
allowClearboolean | { clearIcon?: ReactNode }falsewhether show clear button or customize clear button
autoFocusbooleanfalsewhether auto focus
showTimeboolean | ObjectshowTime optionsto provide an additional time selection
pickertime | date | week | month | yearcontrol which kind of panel should be shown
formatString | String[]depends on whether you set timePicker and your localeuse to format/parse date(without time) value to/from input. When an array is provided, all values are used for parsing and first value for display
use12Hoursbooleanfalse12 hours display mode
valuemomentcurrent value like input's value
defaultValuemomentdefaultValue like input's defaultValue
openbooleanfalsecurrent open state of picker. controlled prop
suffixIconReactNodeThe custom suffix icon
prevIconReactNodeThe custom prev icon
nextIconReactNodeThe custom next icon
superPrevIconReactNodeThe custom super prev icon
superNextIconReactNodeThe custom super next icon
disabledbooleanfalsewhether the picker is disabled
placeholderStringpicker input's placeholder
getPopupContainerfunction(trigger)to set the container of the floating layer, while the default is to create a div element in body
onChangeFunction(date: moment, dateString: string)a callback function, can be executed when the selected time is changing
onOpenChangeFunction(open:boolean)called when open/close picker
onFocus(event:React.FocusEvent\) => voidcalled like input's on focus
onBlur(event:React.FocusEvent\) => voidcalled like input's on blur
onKeyDown(event:React.KeyboardEvent\, preventDefault: () => void) => voidinput on keydown event
directionString: ltr or rtlLayout direction of picker component, it supports RTL direction too.

PickerPanel

PropertyTypeDefaultDescription
prefixClsStringrc-pickerprefixCls of this component
classNameString''additional css class of root dom
styleReact.CSSPropertiesadditional style of root dom node
localeObjectimport from 'rc-picker/lib/locale/en_US'rc-picker locale
valuemomentcurrent value like input's value
defaultValuemomentdefaultValue like input's defaultValue
defaultPickerValuemomentSet default display picker view date
modetime | datetime | date | week | month | year | decadecontrol which kind of panel
pickertime | date | week | month | yearcontrol which kind of panel
tabIndexNumber0view tabIndex
showTimeboolean | ObjectshowTime optionsto provide an additional time selection
showTodaybooleanfalsewhether to show today button
disabledDateFunction(date:moment) => booleanwhether to disable select of current date
dateRenderFunction(currentDate:moment, today:moment) => React.Nodecustom rendering function for date cells
monthCellRenderFunction(currentDate:moment, locale:Locale) => React.NodeCustom month cell render method
renderExtraFooter(mode) => React.Nodeextra footer
onSelectFunction(date: moment)a callback function, can be executed when the selected time
onPanelChangeFunction(value: moment, mode)callback when picker panel mode is changed
onMouseDown(event:React.MouseEvent\) => voidcallback when executed onMouseDown event
directionString: ltr or rtlLayout direction of picker component, it supports RTL direction too.

RangePicker

PropertyTypeDefaultDescription
prefixClsStringrc-pickerprefixCls of this component
classNameString''additional css class of root dom
styleReact.CSSPropertiesadditional style of root dom node
localeObjectimport from 'rc-picker/lib/locale/en_US'rc-picker locale
valuemomentcurrent value like input's value
defaultValuemomentdefaultValue like input's defaultValue
defaultPickerValuemomentSet default display picker view date
separatorString'~'set separator between inputs
pickertime | date | week | month | yearcontrol which kind of panel
placeholderString, Stringplaceholder of date input
showTimeboolean | ObjectshowTime optionsto provide an additional time selection
showTime.defaultValuemoment, momentto set default time of selected date
use12Hoursbooleanfalse12 hours display mode
disabledTimeFunction(date: moment, type:'start'|'end'):Objectto specify the time that cannot be selected
ranges{ String | range: string: moment[] } | { range: string: () => moment[] }preseted ranges for quick selection
formatString | String[]depends on whether you set timePicker and your localeuse to format/parse date(without time) value to/from input. When an array is provided, all values are used for parsing and first value for display
allowEmptyboolean, booleanallow range picker clearing text
selectableboolean, booleanwhether to selected picker
disabledbooleanfalsewhether the range picker is disabled
onChangeFunction(value:moment, formatString: string, string)a callback function, can be executed when the selected time is changing
onCalendarChangeFunction(value:moment, formatString: string, string, info: { range:'start'|'end' })a callback function, can be executed when the start time or the end time of the range is changing
directionString: ltr or rtlLayout direction of picker component, it supports RTL direction too.
orderbooleantrue(TimeRangePicker only) false to disable auto order

showTime-options

PropertyTypeDefaultDescription
formatStringmoment format
showHourbooleantruewhether show hour
showMinutebooleantruewhether show minute
showSecondbooleantruewhether show second
use12Hoursbooleanfalse12 hours display mode
hourStepNumber1interval between hours in picker
minuteStepNumber1interval between minutes in picker
secondStepNumber1interval between seconds in picker
hideDisabledOptionsbooleanfalsewhether hide disabled options
defaultValuemomentnulldefault initial value

Development

npm install
npm start

License

rc-picker is released under the MIT license.

4.5.0

2 days ago

4.4.2

3 days ago

4.4.1

11 days ago

4.4.0

11 days ago

4.3.2

15 days ago

4.3.1

16 days ago

3.14.7

1 month ago

4.3.0

2 months ago

4.2.1

2 months ago

4.2.0

2 months ago

4.1.5

2 months ago

4.1.4

2 months ago

4.1.3

2 months ago

4.1.2

2 months ago

4.1.0

3 months ago

4.1.1

3 months ago

4.0.0-alpha.44

3 months ago

4.0.0-alpha.42

3 months ago

4.0.0-alpha.43

3 months ago

4.0.0-alpha.40

3 months ago

4.0.0-alpha.39

3 months ago

4.0.0-alpha.37

3 months ago

4.0.0-alpha.36

3 months ago

4.0.0-alpha.35

3 months ago

4.0.0-alpha.34

4 months ago

4.0.0-alpha.33

4 months ago

4.0.0-alpha.32

4 months ago

4.0.0-alpha.30

4 months ago

4.0.0-alpha.28

4 months ago

4.0.0-alpha.23

4 months ago

4.0.0-alpha.21

4 months ago

4.0.0-alpha.20

4 months ago

4.0.0-alpha.19

4 months ago

4.0.0-alpha.18

4 months ago

4.0.0-alpha.17

4 months ago

4.0.0-alpha.16

4 months ago

4.0.0-alpha.15

4 months ago

4.0.0-alpha.14

4 months ago

4.0.0-alpha.13

4 months ago

4.0.0-alpha.12

4 months ago

4.0.0-alpha.11

4 months ago

4.0.0-alpha.10

4 months ago

4.0.0-alpha.9

4 months ago

4.0.0-alpha.7

4 months ago

4.0.0-alpha.5

4 months ago

4.0.0-alpha.6

4 months ago

4.0.0-alpha.3

4 months ago

4.0.0-alpha.4

4 months ago

4.0.0-alpha.1

4 months ago

4.0.0-alpha.2

4 months ago

4.0.0-alpha.0

4 months ago

3.14.5

7 months ago

3.14.6

6 months ago

3.14.1

8 months ago

3.14.0

8 months ago

3.14.3

7 months ago

3.14.2

7 months ago

3.14.4

7 months ago

3.13.2

8 months ago

3.13.1

8 months ago

3.12.0

9 months ago

3.13.0

9 months ago

3.9.0

10 months ago

3.8.0

11 months ago

3.10.0

10 months ago

3.8.2

11 months ago

3.8.1

11 months ago

3.11.0

10 months ago

3.11.2

9 months ago

3.11.1

9 months ago

3.7.5

11 months ago

3.7.6

11 months ago

2.7.4

8 months ago

2.7.3

9 months ago

2.7.6

8 months ago

2.7.5

8 months ago

3.7.1

12 months ago

3.7.0

12 months ago

3.7.4

12 months ago

3.7.3

12 months ago

3.7.2

12 months ago

3.6.2

1 year ago

3.6.1

1 year ago

2.7.2

1 year ago

2.7.1

1 year ago

3.5.2

1 year ago

3.2.2

1 year ago

3.2.1

1 year ago

3.2.0

1 year ago

3.2.4

1 year ago

3.2.3

1 year ago

3.1.5

1 year ago

3.6.0

1 year ago

3.6.0-alpha.0

1 year ago

3.5.1

1 year ago

3.5.0

1 year ago

3.4.0

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago

3.3.4

1 year ago

3.3.3

1 year ago

3.3.2

1 year ago

2.6.11

2 years ago

2.7.0

1 year ago

3.1.3

1 year ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.1.4

1 year ago

3.0.0-1

2 years ago

3.0.0-2

2 years ago

3.0.0-4

2 years ago

2.6.10

2 years ago

2.6.9

2 years ago

2.6.8

2 years ago

2.6.5

2 years ago

2.6.7

2 years ago

2.6.6

2 years ago

2.6.1

2 years ago

2.6.0

2 years ago

2.6.3

2 years ago

2.6.2

2 years ago

2.6.4

2 years ago

2.5.19

3 years ago

2.5.18

3 years ago

2.5.17

3 years ago

2.5.15

3 years ago

2.5.14

3 years ago

2.5.13

3 years ago

2.5.12

3 years ago

2.5.10

3 years ago

2.5.6

3 years ago

2.5.7

3 years ago

2.5.5

3 years ago

2.5.4

3 years ago

2.5.2

3 years ago

2.5.1

3 years ago

2.5.0

3 years ago

2.4.3

3 years ago

2.4.2

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.4

3 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.11

4 years ago

2.0.10

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

1.15.4

4 years ago

2.0.5

4 years ago

1.15.3

4 years ago

1.15.2

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.15.1

4 years ago

1.15.0

4 years ago

1.14.0

4 years ago

1.13.1

4 years ago

1.13.0

4 years ago

1.10.7

4 years ago

1.12.1

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.6

4 years ago

1.10.5

4 years ago

1.10.4

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.16

4 years ago

1.4.15

4 years ago

1.4.14

4 years ago

1.4.12

4 years ago

1.4.11

4 years ago

1.4.10

4 years ago

1.4.9

4 years ago

1.4.8

4 years ago

1.4.7

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.1.5

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.0.1-rc.7

4 years ago

0.0.1-rc.6

4 years ago

0.0.1-rc.4

4 years ago

0.0.1-rc.5

4 years ago

0.0.1-rc.3

4 years ago

0.0.1-rc.2

4 years ago

0.0.1-rc.0

4 years ago

0.0.1-rc.1

4 years ago

0.0.1-alpha.64

4 years ago

0.0.1-alpha.63

4 years ago

0.0.1-alpha.60

4 years ago

0.0.1-alpha.62

4 years ago

0.0.1-alpha.59

4 years ago

0.0.1-alpha.58

4 years ago

0.0.1-alpha.56

4 years ago

0.0.1-alpha.57

4 years ago

0.0.1-alpha.55

4 years ago

0.0.1-alpha.54

4 years ago

0.0.1-alpha.53

4 years ago

0.0.1-alpha.50

4 years ago

0.0.1-alpha.52

4 years ago

0.0.1-alpha.51

4 years ago

0.0.1-alpha.49

4 years ago

0.0.1-alpha.47

4 years ago

0.0.1-alpha.48

4 years ago

0.0.1-alpha.46

4 years ago

0.0.1-alpha.45

4 years ago

0.0.1-alpha.44

4 years ago

0.0.1-alpha.41

4 years ago

0.0.1-alpha.40

4 years ago

0.0.1-alpha.43

4 years ago

0.0.1-alpha.42

4 years ago

0.0.1-alpha.34

4 years ago

0.0.1-alpha.36

4 years ago

0.0.1-alpha.35

4 years ago

0.0.1-alpha.38

4 years ago

0.0.1-alpha.37

4 years ago

0.0.1-alpha.39

4 years ago

0.0.1-alpha.33

4 years ago

0.0.1-alpha.32

4 years ago

0.0.1-alpha.31

4 years ago

0.0.1-alpha.30

4 years ago

0.0.1-alpha.29

4 years ago

0.0.1-alpha.28

4 years ago

0.0.1-alpha.27

4 years ago

0.0.1-alpha.25

4 years ago

0.0.1-alpha.24

4 years ago

0.0.1-alpha.26

4 years ago

0.0.1-alpha.23

4 years ago

0.0.1-alpha.22

4 years ago

0.0.1-alpha.21

4 years ago

0.0.1-alpha.20

4 years ago

0.0.1-alpha.14

4 years ago

0.0.1-alpha.16

4 years ago

0.0.1-alpha.15

4 years ago

0.0.1-alpha.18

4 years ago

0.0.1-alpha.17

4 years ago

0.0.1-alpha.19

4 years ago

0.0.1-alpha.13

4 years ago

0.0.1-alpha.12

4 years ago

0.0.1-alpha.11

4 years ago

0.0.1-alpha.10

4 years ago

0.0.1-alpha.9

4 years ago

0.0.1-alpha.8

4 years ago

0.0.1-alpha.7

4 years ago

0.0.1-alpha.6

4 years ago

0.0.1-alpha.5

4 years ago

0.0.1-alpha.4

4 years ago

0.0.1-alpha.3

4 years ago

0.0.1-alpha.2

4 years ago

0.0.1-alpha.1

4 years ago

0.0.1-alpha.0

4 years ago

0.0.0

4 years ago