1.0.0 β€’ Published 4 months ago

react-native-animated-chip v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Installation

Add the dependency:

npm i react-native-animated-chip

Peer Dependencies

"react": ">= 16.x.x",
"react-native-reanimated": ">= 3.x.x",

Usage

πŸ’— Import

import AnimatedChip from "react-native-animated-chip";

✍🏻 Example Data

const CHIP_DATA: ChipType[] = [
  {
    id: 1,
    text: 'Friends',
  },
  {
    id: 2,
    text: 'πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ How I Met Your Mother',
  },
  {
    id: 3,
    text: 'Prison Break',
  },

];

πŸ‘πŸ» Usage

<AnimatedChip
  activeId={3}
  data={CHIP_DATA}
  onPress={(selected) => {
    console.log(selected);
  }}
/>

πŸ“± Example Project

You can checkout the example project πŸ₯°

Simply run

  • npm i
  • react-native run-ios/android

should work of the example project.

Configuration - Props

PropertyTypeDefaultDescription
dataChipType[][]An array of chip objects to display
activeIdstring | numbernullThe ID of the currently active chip
activeBackgroundColorstring'#d4a8d6'The background color of the active chip
backgroundColorstring'#EEE7D1'The background color of inactive chips
activeTextColorstring'#7d3577'The text color of the active chip
buttonStyleViewStyle{}Additional styles to apply to the chip button
contentContainerStyleViewStyle{}Additional styles to apply to the container of chips
textStyleTextStyle{}Additional styles to apply to the chip text
textColorstring'#DCCA92'The text color of inactive chips
onPress(chip: ChipType) => void() => {}A function that will be called when a chip is pressed, it receives the chip object as its argument

Future Plans

  • LICENSE
  • Add customizable animation
  • Add single and multi selection feature

Change Log

Change log will be here !

Author

Sevval Eygul, sevvalleygull@gmail.com

License

React Native Animated Chip is available under the MIT license. See the LICENSE file for more info.