react-native-dropdown-step
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

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

Package Sidebar

Install

npm i react-native-dropdown-step

Weekly Downloads

0

Version

1.1.4

License

MIT

Unpacked Size

57.1 kB

Total Files

12

Last publish

Collaborators

  • krishna.paul