JGuang

Tag

Tag · Ant Design Mobile

Preview
npm install antd-mobile@5.43.0

Tag

Small tags for tagging and categorization.

Install

npm install antd-mobile@5.43.0

antd-mobile is for mobile web, not React Native or Mini Programs. React 19 projects must register createRoot with unstableSetRender at the entry, or imperative APIs such as Toast and Dialog cannot render. Switch dark mode with <html data-prefers-color-scheme="dark">.

Examples come from the official Ant Design Mobile repository (MIT) at the commit published as npm 5.43.0. Presentation helpers such as DemoBlock are JGuang rewrites, not antd-mobile APIs.

Small tags for tagging and categorization.

When to Use

  • Attributes and dimensions suitable for marking things.
  • sort.

Demos

Tag

Props

NameDescriptionTypeDefault
colorLabel color'default' | 'primary' | 'success' | 'warning' | 'danger' | string'default'
fillFilled mode'solid' | 'outline''solid'
onClickThe click event(event: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void-
roundWhether it is rounded cornersbooleanfalse

CSS Variables

NameDescriptionDefaultGlobal
--background-colorBackground color of the tagIf fill=solid , default value is the color of the color prop. If fill=outline, default value is #ffffff.-
--border-colorBorder color of the tagColor of the color prop.-
--border-radiusBorder radius of the tag when round=false2px--adm-tag-border-radius
--text-colorText color of the tagIf fill=solid, default value is #ffffff. If fill=outline, default value is the color of the color prop.-