组件契约
badge
用于标注类型、状态或类别的小型标签。
- 版本
- v1.0.0
Props
| 名称 | 类型 | 取值 | 默认值 |
|---|---|---|---|
| variant | enum | neutral, ui-component, recipe, agent, config | neutral |
插槽
- 名称
- default
- 用途
- badge label content
Token
- font
- primitive.font.family
无障碍
- native_element
- span
- role
- none (decorative or content-derived)
- notes
- badge conveys categorical meaning via its label text; screen readers read the slot text. Consumers who need programmatic role semantics (e.g. status badges) should add role/aria via the host attribute.
经过校验的原始 JSON
{
"name": "badge",
"version": "1.0.0",
"props": {
"variant": {
"type": "enum",
"values": [
"neutral",
"ui-component",
"recipe",
"agent",
"config"
],
"default": "neutral"
}
},
"slot": {
"name": "default",
"purpose": "badge label content"
},
"tokens_used": {
"font": [
"primitive.font.family"
]
},
"a11y": {
"native_element": "span",
"role": "none (decorative or content-derived)",
"notes": "badge conveys categorical meaning via its label text; screen readers read the slot text. Consumers who need programmatic role semantics (e.g. status badges) should add role/aria via the host attribute."
}
}