Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@freakycoder/react-native-single-select

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@freakycoder/react-native-single-select

Customizable & Easy to Use Single Select Library for React Native

Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
77
-23.76%
Maintainers
1
Weekly downloads
 
Created
Source
React Native Single Select

Customizable & Easy to Use Single Select Library for React Native

npm version npm Platform - Android and iOS License: MIT styled with prettier

React Native Single Select

Installation

Add the dependency:

npm i @freakycoder/react-native-single-select

Usage

Import

import RNSingleSelect, {
  ISingleSelectDataType,
} from "@freakycoder/react-native-single-select";

Fundamental Usage

<RNSingleSelect
  data={staticData}
  onSelect={(selectedItem: ISingleSelectDataType) =>
    console.log("SelectedItem: ", selectedItem)
  }
/>

Menu Item Format

You must use this format for generating menu bar item.

const staticData: Array<ISingleSelectDataType> = [
  { id: 0, value: "Euismod Justo" },
  { id: 1, value: "Risus Venenatis" },
  { id: 2, value: "Vestibulum Ullamcorper" },
  { id: 3, value: "Lorem Nibh" },
  { id: 4, value: "Ligula Amet" },
];

Also, here is the interface of ISingleSelectDataType:

export interface ISingleSelectDataType {
  id: number;
  value: string;
}

Configuration - Props

menuItemTextStyle: TextStyle;

PropertyTypeDefaultDescription
onSelectfunctionundefinedset the selection function when a menu item is selected
dataArrayundefinedset the menu item data array for generating menu bar items
placeholderstring"Select"Change the placeholder of the single select component
buttonContainerStyleViewStyledefaultchange/override the top of the single select button (the main one)
menuBarContainerStyleViewStyledefaultchange/override the top of the single select bottom menu bar
arrowImageStyleImageStyledefaultchange/override the top of the arrow image's style
menuItemTextStyleTextStyledefaultchange/override the top of the each menu bar's item text style

Future Plans

  • LICENSE
  • Customizable Animations
  • Dark Theme / Light Theme Options
  • Customizable Image Component
  • Customizable Text Component
  • Write an article about the lib on Medium

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Single Select is available under the MIT license. See the LICENSE file for more info.

Keywords

single-select

FAQs

Package last updated on 04 Sep 2020

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