1.1.4 • Published 2 years ago

react-native-dropdown-step v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Native DropDownStep

Get started by

npm i react-native-dropdown-step

or

yarn add react-native-dropdown-step

Usage

import { DropDownStep } from 'react-native-dropdown-step';

interface item {
    // describe your item component data
    // if not using typescript you can just skip the typescript annotations
}

  <DropDownStep<item>
    data={Items} // Required: Array of data, if the types are given, types must match
    getValue={(item) => item.value} // Required: retrieve value from single item
    label={(item) => item.name} // Required: retrieve label from single item
    title="Select Items" // Label above the dropdown or pass nothing to don't show
    onChange={(item) => {
        // when new item is selected
    }}
    renderItem={({onPress, label, selected}) => { // There is a default type
        return <RenderItemThisWay onPress={onPress} label={label} selected={selected} />
    }}
    style={styles.dropdownstep} // style of the container of dropdown modal
    status={CurrentStatusOfData} // four available status: loading, loaded, initial, error 
    defaultValue={SomeDefaultValue} 
  />

Features Coming Next

  1. Variants
  2. Replacable DropDown Arrow Icon
  3. Multiple Selection Support

Example Screenshots

Initial Status When DropDown is Selected After Selection