1.1.0 • Published 7 years ago

react-native-label-select v1.1.0

Weekly downloads
218
License
MIT
Repository
-
Last release
7 years ago

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-objectYou can customize styles of modalText / outerCircle / innerCircle by `customStyle.

Use ref property as a hook to invoke internal methods.

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

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago