Socket
Book a DemoInstallSign in
Socket

react-native-searchable-dropdown-opensource

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-searchable-dropdown-opensource

a searchable dropdown library for react native

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

React Native Custom Dropdown

A customizable React Native dropdown component with optional styling options.

Installation

Install the package using npm or yarn:

npm i react-native-searchable-dropdown-opensource

##Usage

import React, { useState } from 'react';
import CustomDropdown from 'react-native-searchable-dropdown-opensource';

const App = () => {
  const options = ['Option 1', 'Option 2', 'Option 3', 'Option 5'];
  const [selectedOption, setSelectedOption] = useState('Select an option');

  const handleSelect = (option) => {
    setSelectedOption(option);
  };

  return (
    <View>
      <Text>Selected Option: {selectedOption}</Text>

<CustomDropdown options={options} onSelect={handleSelect} selectedOption={selectedOption}
buttonStyle={{}}
buttonTextStyle={{}}
dropdownStyle={{}}
textStyle={{}}
searchStyle={{backgroundColor:'white'}}
scroll
itemsVisible={2}
/>

    </View>
  );
};

export default App;

#Props #Required Props

  • options: An array of options to be displayed in the dropdown.
  • onSelect: A callback function triggered when an option is selected.
  • selectedOption: The currently selected option.

##Optional Props

  • buttonStyle: Additional styles for the dropdown button.
  • buttonTextStyle: Additional styles for the button text.
  • dropdownStyle: Additional styles for the dropdown container.
  • textStyle: Additional styles for the text within the dropdown.
  • scroll: Enable scrolling in the dropdown.
  • itemsVisible: Number of items visible in the dropdown (if scrolling is enabled).

##Example


<CustomDropdown options={options} onSelect={handleSelect} selectedOption={selectedOption}
buttonStyle={{}}
buttonTextStyle={{}}
dropdownStyle={{}}
textStyle={{}}
searchStyle={{backgroundColor:'white'}}
scroll
itemsVisible={2}
/>

Keywords

react-native

FAQs

Package last updated on 11 Feb 2024

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.