Socket
Socket
Sign inDemoInstall

react-native-floating-tag-button

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-floating-tag-button

a ready-to-use floating button component with animated tags


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-native-floating-tag-button

Desktop 05-08-22 14-52-07

A floating button with animated tags that you can add to.

Installations

npm install react-native-floating-tag-button --save
yarn install react-native-floating-tag-button

Usage

import { TagSource, TagButton } from 'react-native-floating-tag-button';

const data: TagSource[] = [
   { value: 'Tag 1', label: 'test 1' },
   { value: 'Tag 2', label: 'test 2' },
   { value: 'Tag 3', label: 'test 3' },
];

const onSelect = (selectedTag: string[]) => {
   //do something with selectedTag
};

<TagButton
  dataSource={data}
  onTagSelected={onSelect}
  icon={
    <Ionicons
      name="menu"
      size={24}
      color="white"
      style={{ backgroundColor: 'blue', borderRadius: 180, padding: 10 }}
    />
  }
  position={{ bottom: 15, right: 15 }}
  tagContainerStyle={{
  backgroundColor: 'red',
  marginRight: 10,
  }}
  textStyle={{ color: 'yellow', fontSize: 14 }}
  activeTagContainerStyle={{ backgroundColor: 'green' }}
  activeTextStyle={{ color: 'white' }}
  tintColor="black"
  touchableOpacity />

Properties

PropDescriptionTypeDefaultIs Required
dataSourcethe tags to display and use.TagSource[][]yes
onTagSelectedthe callback method when a tag is selected.(tags: string[]) => voidnoneyes
iconthe element to display as the floating button to hide and show the tags. the element can be an icon, a text, an image, etc.JSX.Elementnoneyes
sortTagsif true, the tags will be sorted alphabetically.booleanfalseno
positionan object to define the position of the button on the screen.{ top?: number; left?: number; right?: number; bottom?: number; } { bottom: 10, right: 5 }no
directiondefine the direction of the alignement between the floating button and his tags.'row' | 'row-reverse' | 'column' | 'column-reverse'columnno
tagContainerStylethe style of the container of the tags.StyleProp<ViewStyle>{ backgroundColor: '#787878', borderRadius: 180, width: 75 }no
textStylethe style of the labels of the tags.StyleProp<TextStyle>{ color: '#ffffff', fontSize: 14 }no
activeTagContainerStylethe style of the container of the tags when selected.StyleProp<ViewStyle>{ backgroundColor: 'white', paddingHorizontal: 8, paddingVertical: 4, borderRadius: 4, borderWidth: 1 }no
activeTextStylethe style of the labels of the tags when selected.StyleProp<TextStyle>{ color: '#333' }no
tintColor?the color of the border of the tags.string00a8ffno
touchableOpacity?if true, the tags will use a touchable opacity as clickable component, otherwise they will use a touchable without feedback.booleanfalseno
animationDuration?the duration of the animation when the tags are shown.number200no

A complete minimal example can be found Here.

Contributing

See the contributing guide to learn how to contribute to the repository.

License

MIT

Keywords

FAQs

Last updated on 05 Aug 2022

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