1.0.8 • Published 6 years ago

react-native-select-list2 v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

React Native Select List

Simple select for React Native Applications.

GitHub issues GitHub license

Instalation

npm i react-native-select-list2 --save

Usage

import { Select, Option } from 'react-native-select-list';

<Select>
  <Option value={1}>List item 1</Option>
  <Option value={2}>List item 2</Option>
  <Option value={3}>List item 3</Option>
</Select>

Select properties

PropTypeDefaultDescription
onSelectFunctionnullThis function is invoked when some option is selected.
paddingnumber10Horizontal padding for select box. Text is always centered vertially.
zIndexnumber999It is used to pop the select above all other elements.
selectStyleObjectnullSet custom style to your select.
selectTextStyleObjectnullSet custom style to your select box text.
caretstring or React elementnullYou can set default caret with setting this property to 'down' or 'up'. If you want to set some custom image or view you can set an element to the caret property. Explicitly set width and height to caret element if you are using an Image element.
caretSizenumber15Customize caret size. It is used only when caret is set to 'down' or 'up'.
caretColorstring'#333333'Customize caret color. It is used only when caret is set to 'down' or 'up'.
listHeightnumber100The maximum list height.
listPositionstring'down'Change position of dropdown list. You can set it 'up', so it will shows above the select. If dropdown cannot fit the screen size it will expand to the oposite direction.
listStyleObjectnullStyles for dropdown list.

Option properties

PropTypeDefaultDescription
optionStyleObjectnullSet custom style to Option element.
optionTextStyleObjectnullSet custom style to Option text.
lastbooleanfalseAdd it to last element so it will not have bottom border.