You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

searchable-dropdown-react-native

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

searchable-dropdown-react-native

A searchable dropdown in React Native.

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

Searchable Dropdown React Native

Searchable Dropdown in react native, usable with Expo. Allow you to handle single and multiple selections.

Screenshots

first third second

Installation

npm install --save searchable-dropdown-react-native

Properties

NameDescriptionTypeDefaultRequired
optionsThe options for the component.arrayYes
selectedValuesThe values currently selected.arrayYes
setSelectedValuesThe callback to handle the selection of itemsfuncYes
labelThe label of the dropdownstringNo
placeholderDefault text to be shown to the userstring'Select an item'No
inputSizeSize of the input.number150No
addNewElementTextThe text that will be shown to add a new element is the options.stringAdd an itemNo
rightIconThe icon on the right of the input (if you want one).anyNo
selectedElementColorColor of the selected items.stringNo
labelStyleAdditional styles for the label.object{}No
containerStyleAdditional styles for the container view.object{}No
itemStyleAdditional styles for the items.object{}No
labelStyleAdditional styles for the labels.object{}No
inputContainerStyleAdditional styles for the input container.object{}No
inputColorThe color of the input.stringNo

Example

import React, { useState } from "react";
import SearchableDropdown from "searchable-dropdown-react-native";

let items = [
  {
    id: 1,
    name: "JavaScript",
    value: "JavaScript"
  },
  {
    id: 2,
    name: "Java",
    value: "Java"
  },
  {
    id: 3,
    name: "Ruby",
    value: "Ruby"
  },
  {
    id: 4,
    name: "React Native",
    value: "React Native"
  },
  {
    id: 5,
    name: "PHP",
    value: "PHP"
  },
  {
    id: 6,
    name: "Python",
    value: "Python"
  },
  {
    id: 7,
    name: "Go",
    value: "Go"
  },
  {
    id: 8,
    name: "Swift",
    value: "Swift"
  }
];

export default function App() {
  const [selectedValues, setSelectedValues] = useState([]);

  return (
    <SearchableDropdown
      options={items}
      selectedValues={selectedValues}
      setSelectedValues={setSelectedValues}
      label="test dropdown"
      placeholder="Test placeholder"
      inputSize={300}
    />
  );
}

Keywords

react

FAQs

Package last updated on 21 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts