English | 中文
Tag for categorizing or markup. It supports the following features:
- customize color
- two types:
outline
andsolid
- closable and its callback
npm install @rn-components-kit/tag --save
Preview | Code |
---|---|
![]() |
Demo1 Code |
![]() |
Demo2 Code |
![]() ![]() |
Demo3 Code |
style
text
type
color
fontSize
paddingHorizontal
paddingVertical
borderRadius
borderColor
animatedWhenDisappear
animationDuration
closable
onClose
Allow you to customize style
Type | Required | Default |
---|---|---|
object | no | - |
Text inside tag to display
Type | Required | Default |
---|---|---|
string | yes | '' |
Determines the tag's type (outline or solid)
Type | Required | Default |
---|---|---|
enum('outline' , 'solid' ) |
no | 'outline' |
Determines the tag's color
Type | Required | Default |
---|---|---|
string | no | '#333' |
Determines the fontSize of tag's text
Type | Required | Default |
---|---|---|
number | no | 14 |
Padding value in the horizontal orientation
Type | Required | Default |
---|---|---|
number | no | 4 |
Padding value in the vertical orientation
Type | Required | Default |
---|---|---|
number | no | 1 |
Determines the border radius value of tag
Type | Required | Default |
---|---|---|
number | no | 3 |
Color of tag's border. If it is not set, the default is the same as color
Type | Required | Default |
---|---|---|
string | no | - |
Determines whether an animation enabled when the tag is closed
Type | Required | Default |
---|---|---|
boolean | no | false |
Determines how long the disappearing animation will take when tag is closed. (ms)
Type | Required | Default |
---|---|---|
number | no | 300 |
Determines whether a tag can be closed
Type | Required | Default |
---|---|---|
boolean | no | false |
(text: string) => void
A callback will be triggered when the tag is closed
Type | Required | Default |
---|---|---|
function | no | () => {} |