1.0.3 • Published 5 years ago

@rn-components-kit/tag v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Tag

NPM version

English | 中文

Tag for categorizing or markup. It supports the following features:

  • customize color
  • two types: outline and solid
  • closable and its callback

How to use

npm install @rn-components-kit/tag --save
PreviewCode
Demo1 Code
Demo2 Code
Demo3 Code

Props

Reference

Props

style

Allow you to customize style

TypeRequiredDefault
objectno-

text

Text inside tag to display

TypeRequiredDefault
stringyes''

type

Determines the tag's type (outline or solid)

TypeRequiredDefault
enum('outline', 'solid')no'outline'

color

Determines the tag's color

TypeRequiredDefault
stringno'#333'

fontSize

Determines the fontSize of tag's text

TypeRequiredDefault
numberno14

paddingHorizontal

Padding value in the horizontal orientation

TypeRequiredDefault
numberno4

paddingVertical

Padding value in the vertical orientation

TypeRequiredDefault
numberno1

borderRadius

Determines the border radius value of tag

TypeRequiredDefault
numberno3

borderColor

Color of tag's border. If it is not set, the default is the same as color

TypeRequiredDefault
stringno-

animatedWhenDisappear

Determines whether an animation enabled when the tag is closed

TypeRequiredDefault
booleannofalse

animationDuration

Determines how long the disappearing animation will take when tag is closed. (ms)

TypeRequiredDefault
numberno300

closable

Determines whether a tag can be closed

TypeRequiredDefault
booleannofalse

onClose

(text: string) => void

A callback will be triggered when the tag is closed

TypeRequiredDefault
functionno() => {}