Badge
Small status label or count.
NewDraftBetaStableDeprecatedRemoved12
Import
Section titled “Import”import { Badge } from "@pelagornis/page/components";Example
Section titled “Example”The preview above renders this file. Copy it into src/components/ to start from it.
import { Badge, Stack } from "@pelagornis/page/components";
export default function BadgeDemo() { return ( <Stack direction="row" gap="sizeSmall" align="center" wrap> <Badge>New</Badge> <Badge variant="neutral">Draft</Badge> <Badge variant="outline">Beta</Badge> <Badge variant="success">Stable</Badge> <Badge variant="warning">Deprecated</Badge> <Badge variant="danger">Removed</Badge> <Badge variant="danger" layout="number"> 12 </Badge> </Stack> );}Use in MDX
Section titled “Use in MDX”Badge can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.
---title: Example---
import { Badge } from "@pelagornis/page/components";
<Badge variant="success">Stable</Badge><Badge variant="danger" layout="number">12</Badge>Use in Markdoc
Section titled “Use in Markdoc”pageMarkdoc() registers a badge tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.
{% badge variant="success" %}Stable{% /badge %}Attributes use the same names and values as the React props.
Variants
Section titled “Variants”Values the component accepts for each variant prop.
| Prop | Values |
|---|---|
variant | default neutral outline success warning danger |
layout | label number |
Anatomy
Section titled “Anatomy”Parts of the component and the data-refineui role each one renders.
| Part | Role |
|---|---|
root | badge |
Reference
Section titled “Reference”- RefineUI · Badge for design guidance and token detail.
- Use in MDX and Use in Markdoc for the general rules.