Tag
Tags help people filter content or see metadata at a glance.
import { Tag } from '@cerberus/react'
Usage
You can mix and match all of the examples to create the tag style of your choosing.
With Icon
Closable
To use a closable tag, just pass an onClick
prop to the Tag
component.
Customization
You can customize the tag by utilizing the cx
function.
API
export type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagVariantProps & { onClick?: never }
export type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & { gradient?: never palette?: never onClick: MouseEventHandler<HTMLSpanElement> shape?: never usage?: never}
export type TagProps = StaticTagProps | ClickableTagProps
define function Tag(props: PropsWithChildren<TagProps>): ReactNode
Props
The Tag
component accepts the following props:
Name | Default | Description |
---|---|---|
gradient | undefined | The gradient of the tag (overrides palette). |
palette | page | The color palette of the tag (overrides gradient). |
usage | filled | The style treatment of the tag. |
shape | square | The shape of the tag. |
onClick | undefined | How to create a Closable tag. |
import { Tag } from '@cerberus/react'
Usage
You can mix and match all of the examples to create the tag style of your choosing.
With Icon
Closable
To use a closable tag, just pass an onClick
prop to the Tag
component.
Customization
You can customize the tag by utilizing the cx
function.
API
export type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagVariantProps & { onClick?: never }
export type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & { gradient?: never palette?: never onClick: MouseEventHandler<HTMLSpanElement> shape?: never usage?: never}
export type TagProps = StaticTagProps | ClickableTagProps
define function Tag(props: PropsWithChildren<TagProps>): ReactNode
Props
The Tag
component accepts the following props:
Name | Default | Description |
---|---|---|
gradient | undefined | The gradient of the tag (overrides palette). |
palette | page | The color palette of the tag (overrides gradient). |
usage | filled | The style treatment of the tag. |
shape | square | The shape of the tag. |
onClick | undefined | How to create a Closable tag. |
import { Tag } from '@cerberus/react'
Usage
You can mix and match all of the examples to create the tag style of your choosing.
With Icon
Closable
To use a closable tag, just pass an onClick
prop to the Tag
component.
Customization
You can customize the tag by utilizing the cx
function.
API
export type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagVariantProps & { onClick?: never }
export type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & { gradient?: never palette?: never onClick: MouseEventHandler<HTMLSpanElement> shape?: never usage?: never}
export type TagProps = StaticTagProps | ClickableTagProps
define function Tag(props: PropsWithChildren<TagProps>): ReactNode
Props
The Tag
component accepts the following props:
Name | Default | Description |
---|---|---|
gradient | undefined | The gradient of the tag (overrides palette). |
palette | page | The color palette of the tag (overrides gradient). |
usage | filled | The style treatment of the tag. |
shape | square | The shape of the tag. |
onClick | undefined | How to create a Closable tag. |
import { Tag } from '@cerberus/react'
Usage
You can mix and match all of the examples to create the tag style of your choosing.
With Icon
Closable
To use a closable tag, just pass an onClick
prop to the Tag
component.
Customization
You can customize the tag by utilizing the cx
function.
API
export type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagVariantProps & { onClick?: never }
export type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & { gradient?: never palette?: never onClick: MouseEventHandler<HTMLSpanElement> shape?: never usage?: never}
export type TagProps = StaticTagProps | ClickableTagProps
define function Tag(props: PropsWithChildren<TagProps>): ReactNode
Props
The Tag
component accepts the following props:
Name | Default | Description |
---|---|---|
gradient | undefined | The gradient of the tag (overrides palette). |
palette | page | The color palette of the tag (overrides gradient). |
usage | filled | The style treatment of the tag. |
shape | square | The shape of the tag. |
onClick | undefined | How to create a Closable tag. |