1.0.3 • Published 1 year ago

native-dropdown-widget v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

native-dropdown-widget

React Native Dropown Widget is a library which have the capability to provides a variety of options to customize the dropdown to match the design and functionality of your application.

App gif

Screenshots

Badges

MIT License

Features

  • Easy to use
  • Single or Multiselect option for items
  • Responsive for Cross platform
  • Have wast option for customization
  • Implemented with typescript
Nothing is pleasanter than exploring a library. Give us rate If you like this library :-)

Getting started

npm install native-dropdown-widget --save

or

yarn add native-dropdown-widget

and voilà!!

Dropdown Props

PropsParamsisRequireDescription
dataArrayYesPlain array containing dropdown options.
selectedItemany[]YesArray containing selected items.
setSelectedItem(items: any[]) => voidYesFunction to set selected items.
styleObjectNoStyle object for the dropdown component.
containerStyleObjectNoStyle object for the dropdown container.
innerContainerStyleObjectNoStyle object for the inner container of the dropdown.
innerContentContainerStyleObjectNoStyle object for the inner content container.
listStyleObjectNoStyle object for the dropdown list.
listTextStyleObjectNoStyle object for the text within the dropdown list.
placeholderStringNoPlaceholder text when no option is selected.
placeholderStyleObjectNoStyle object for the placeholder text.
leftIconstringNoIcon to be displayed on the left side.
leftIconStyleobjectNoStyle object for the left icon.
dropDownIconComponentNoCustom component to be used as the dropdown icon.
scrollEnabledBooleanNoEnable/disable scrolling in the dropdown list.
cardContainerStyleObjectNoStyle object for the card container (if used).
cardStyleObjectNoStyle object for the card component (if used).
cardTextStyleObjectNoStyle object for the text within the card (if used).
cardIconComponentNoCustom component to be used as the card icon (if used).
cardIconViewComponentNoCustom component to wrap the card icon (if used).
isInvertedbooleanNoBoolean indicating if the table is inverted.
isOverLaybooleanNoBoolean indicating if the table is overlayed or overlap on behind content.
singleSelectionbooleanNoBoolean indicating single selection mode or want only one selection.

Examples Array - 1

const ExpArray = () => [
  "vvlgray",
  "vlgray",
  "lgray",
  "gray",
  "sgray",
  "vsgray",
];

Call the library directly or Import by copying this below -

import DropDownComponent from "native-dropdown-widget";

Usage/Examples 1 - Basic

const [selectedItem, setSelectedItem] = useState(null);

function App() {
  return (
    <DropDownComponent
      data={ExpArray()}
      placeholder={"gray"}
      scrollEnabled={true}
      isOverLay={false}
      selectedItem={selectedItem}
      setSelectedItem={setSelectedItem}
      dropDownIcon={<></>}
    />
  );
}

Usage/Examples 2 - Inverted list With Icons

(Note - You can use any JSX.Element)

const [selectedItem, setSelectedItem] = useState(null);

function App() {
  return (
    <DropDownComponent
      data={ExpArray()}
      placeholder={"gray"}
      scrollEnabled={true}
      isOverLay={false}
      selectedItem={selectedItem}
      setSelectedItem={setSelectedItem}
      leftIcon={<Text>{"❄"}</Text>}
      isInverted
    />
  );
}

Author

License

MIT