开发预览 更新于 2026-05-10

StatusCodeBadge 状态码徽标

HTTP 状态码徽标,按 1xx / 2xx / 3xx / 4xx / 5xx 自动配色,支持可选 reason 文本。

基础用法

reason 可选,显示在数字后面。边框 + 软色背景双重信号,色盲也可通过数字识别状态类。

200OK201Created301Moved304Not Modified400Bad Request401Unauthorized404Not Found429Too Many500Internal502Bad Gateway504Timeout
<CfStatusCodeBadge :code="200" reason="OK" />
<CfStatusCodeBadge :code="404" reason="Not Found" />
<CfStatusCodeBadge :code="500" reason="Internal" />
<CfStatusCodeBadge code={200} reason="OK" />
<CfStatusCodeBadge code={404} reason="Not Found" />
<CfStatusCodeBadge code={500} reason="Internal" />

API

属性类型默认值说明
codenumberHTTP 状态码
reasonstring可选 reason phrase
size'sm' | 'md' | 'lg''md'
类别范围颜色 token
1xx100–199--status-info
2xx200–299--status-success
3xx300–399--status-info
4xx400–499--status-warning
5xx500–599--status-error

反馈与讨论

StatusCodeBadge 状态码徽标 的讨论

0
0 / 600
一键发送
正在加载评论...