npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-floating-tag-button

v1.0.6

Published

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

Downloads

1

Readme

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

| Prop | Description | Type | Default | Is Required | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|--------------| | dataSource | the tags to display and use. | TagSource[] |[] | yes | | onTagSelected | the callback method when a tag is selected. | (tags: string[]) => void |none | yes | | icon | the 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.Element |none | yes | | sortTags | if true, the tags will be sorted alphabetically. | boolean |false | no | | position | an object to define the position of the button on the screen. | { top?: number; left?: number; right?: number; bottom?: number; } |{ bottom: 10, right: 5 } | no | | direction | define the direction of the alignement between the floating button and his tags. | 'row' \| 'row-reverse' \| 'column' \| 'column-reverse' |column | no | | tagContainerStyle | the style of the container of the tags. | StyleProp<ViewStyle> |{ backgroundColor: '#787878', borderRadius: 180, width: 75 } | no | | textStyle | the style of the labels of the tags. | StyleProp<TextStyle> |{ color: '#ffffff', fontSize: 14 } | no | | activeTagContainerStyle | the style of the container of the tags when selected. | StyleProp<ViewStyle> |{ backgroundColor: 'white', paddingHorizontal: 8, paddingVertical: 4, borderRadius: 4, borderWidth: 1 }| no | | activeTextStyle | the style of the labels of the tags when selected. | StyleProp<TextStyle> |{ color: '#333' } | no | | tintColor? | the color of the border of the tags. | string |00a8ff | no | | touchableOpacity? | if true, the tags will use a touchable opacity as clickable component, otherwise they will use a touchable without feedback. | boolean |false | no | | animationDuration? | the duration of the animation when the tags are shown. | number |200 | no |

A complete minimal example can be found Here.

Contributing

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

License

MIT