Socket
Socket
Sign inDemoInstall

react-native-label-select

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-label-select

A label select component for React Native apps


Version published
Weekly downloads
98
increased by12.64%
Maintainers
1
Install size
17.5 kB
Created
Weekly downloads
 

Readme

Source

react-native-label-select Build Status Coverage Status

LabelSelect is a component used for making multiple choices. The modal is a checkbox like html.

Example

Usage

npm install --save react-native-label-select
import LabelSelect from 'react-native-label-select';
<LabelSelect
  ref="labelSelect"
  title="Make Choices"
  enable={true}
  readOnly={false}
  enableAddBtn={true}
  style={yourStyle}
  onConfirm={(list) => {...}}>

  <LabelSelect.Label
    key={...}
    data={itemA}
    onCancel={func}>selected ItemA</LabelSelect.Label>
  <LabelSelect.ModalItem
    key={...}
    data={itemB}>Item B</LabelSelect.ModalItem>
</LabelSelect>

Properties

LabelSelect

PropDefaultTypeDescription
style-objectSpecify styles for the LabelSelect
title-stringThe title text of the modal
readOnlyfalseboolis the component readonly
enabletrueboolis the component interactive
enableAddBtntrueboolwhether to show the add button
onConfirm-functionTriggered when the confirm button of modal is pressed with the newly selected items list passed as the only argument
confirmText-stringText of confirm button.
cancelText-stringText of cancelText button.
customStyle-objectYou can customize styles of modal / buttonView / confirmButton / confirmText / cancelButton / cancelText by `customStyle.

LabelSelect.Label

PropDefaultTypeDescription
onCancel-functionTriggered when the close button of Label is pressed.
data-anyData that bind to the Label
customStyle-objectYou can customize styles of text by `customStyle.

LabelSelect.ModalItem

PropDefaultTypeDescription
data-anyData that bind to the ModalItem. After confirming the items selected on modal, the data will be passed to the selected list.

Instance Methods

MethodParamsDescription
openModal-Open select modal
cancelSelect-Close select modal. Also triggered when the cancel button of modal being pressed.
customStyle-object

Use ref property as a hook to invoke internal methods.

<LabelSelect ref="select">...</LabelSelect>
this.ref.select.openModal()
this.ref.select.cancelSelect()

Keywords

FAQs

Last updated on 05 May 2017

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