1.0.0 • Published 5 years ago

@rn-components-kit/scroll-picker v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

ScrollPicker

NPM version

English | 中文

Selecting option by scrolling operation. It supports following features:

  • smoothing the differences between Android and iOS platforms
  • multiple picker items
  • cascading operation
  • customized option content in ScrollPicker.Item

How to use

npm install @rn-components-kit/scroll-picker --save
PreviewCode
Demo1 Code
Demo2 Code
Demo3 Code

Props

Reference

Props

style

Allow you to customize style

TypeRequiredDefault
objectno-

itemHeight

Height of each item in ScrollPicker.Item

TypeRequiredDefault
numberno30

onValueChange

(value: {[key: string]: any}) => void;

A callback will be triggered when ScrollPicker.Item's selected value changes

TypeRequiredDefault
functionno() => {}

Props for ScrollPicker.Item

id

A unique identifier in ScrollPicker

TypeRequiredDefault
stringyes-

flex

How much of the remaining space in the flex container

TypeRequiredDefault
numberno1

data

Data source of options

TypeRequiredDefault
T[]yes-

defaultValue

Default value to speficy which option is selected initially (must be one of data)

TypeRequiredDefault
Tnodata0

renderItem

(params: {item: T, index: number}) => React.ReactElement;

Allows you to customize content style

TypeRequiredDefault
functionyes-