New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-badge-input

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-badge-input

Modular badge input for React Native

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

React Native Badge Input

Modular badge input for React Native

Installation

yarn add react-native-badge-input

Usage

import React, { useState } from 'react'
import BadgeInput from 'react-native-badge-input'

let Example = () => {
  let [value, setValue] = useState('')
  let [badges, setBadges] = useState([])
  
  let addBadge = badge =>
    setBadges([...badges, badge])

  let removeBadge = removedBadge =>
    setBadges(
      badges.filter(badge => badge !== removedBadge)
    )

  return (
    <BadgeInput
      value={value}
      onChangeText={setValue}
      badges={badges}
      onBadgePress={removeBadge}
      onSubmitEditing={addBadge}
    />
  )
}

Props

TextInput props...

namerequireddefaultdescription
valueyesCurrent input value
onChangeTextyesTextInput onchangeText
badgesyesAn array of badges
onBadgePressyesBadge on press action
placeholdernoInput placeholder.
inputSuffixnoContent rendered at the end of the input, for example an icon.
badgeStylenoBadge component style
inputPropsnoProps additionally passed to input. This is useful if you want to pass any styles that are overriden by the props object.
keyExtractorno() => stringBadge key extractor.
textExtractorno() => stringBadge text extractor, required when your badge is not a string.

Keywords

react

FAQs

Package last updated on 10 Aug 2019

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