Socket
Socket
Sign inDemoInstall

react-native-searchable-dropdown

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-searchable-dropdown

Searchable Dropdown


Version published
Maintainers
1
Created

Readme

Source

npm license

React Native Searchable Dropdown

Searchable Dropdown help you to search with in the dropdown. and you can pick single item.

example

Installation

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

Properties

PropsDescription
itemsdropdown items
defaultIndexDefault selected index of items. (optional)
onTextChangeon text change you can passs onTextChange and catch the input text. (optional)
onItemSelecton item selection you can passs onItemSelect and catch the input item.
containerStylecomponent container style
textInputStyleTextInput style
itemStyleitems on dropdown
itemTextStyleitem text
resetValuereset textInput Value with true and false state
placeholdertextInput placeholder
placeholderTextColortextInput placeholderTextColor
itemsContainerStyleitems container style you can pass maxHeight to restrict the items dropdown hieght
underlineColorAndroidTextInput underline height

Example

import React, { Component } from 'react';
import  SearchableDropdown from 'react-native-searchable-dropdown';

var  items  = [
	{
		id: 1,
		name: 'Javascript'
	},
	{
		id: 2,
		name: 'Java'
	},
	{
		id: 3,
		name: 'Ruby'
	},
	{
		id: 4,
		name: 'React Native'
	},
	{
		id: 5,
		name: 'PHP'
	},
	{
		id: 6,
		name: 'Python'
	},
	{
		id: 7,
		name: 'Go'
	},
	{
		id: 8,
		name: 'Swift'
	},
];
class Example extends Component {
	  render() {
		<SearchableDropDown
			onTextChange={(text) =>  alert(text)}
			onItemSelect={(item) =>  alert(JSON.stringify(item))}
			containerStyle={{
				padding: 5
			}}
			textInputStyle={{
				padding: 12,
				borderWidth: 1,
				borderColor: '#ccc',
				borderRadius: 5
			}}
			itemStyle={{
				padding: 10,
			    marginTop: 2,
				backgroundColor: '#ddd',
				borderColor: '#bbb',
				borderWidth: 1,
				borderRadius:5
			}}
			itemTextStyle={{
			color: '#222'
			}}
			itemsContainerStyle={{
				maxHeight: 140
			}}
			items={items}
			defaultIndex={2}
			placeholder="Placeholder."
			resetValue={false}
			underlineColorAndroid='transparent' />
	}
}

Keywords

FAQs

Last updated on 06 Sep 2018

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc