Tag
Categorization tag or filter chip. Alias of Chip.
DefaultOutlineFilledRemovable
Import
Section titled “Import”import { Tag } from "@pelagornis/page/components";Example
Section titled “Example”The preview above renders this file. Copy it into src/components/ to start from it.
import { Stack, Tag } from "@pelagornis/page/components";
export default function TagDemo() { return ( <Stack direction="row" gap="sizeSmall" wrap> <Tag variant="default">Default</Tag> <Tag variant="outline">Outline</Tag> <Tag variant="filled">Filled</Tag> <Tag onRemove={() => {}}>Removable</Tag> </Stack> );}Use in MDX
Section titled “Use in MDX”Tag 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 { Tag } from "@pelagornis/page/components";
<Tag variant="outline">Draft</Tag><Tag variant="filled">Published</Tag>Use in Markdoc
Section titled “Use in Markdoc”pageMarkdoc() registers a tag tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.
{% tag variant="outline" %}Draft{% /tag %}{% tag variant="filled" %}Published{% /tag %}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 outline filled |
size | sm md lg |
Anatomy
Section titled “Anatomy”Parts of the component and the data-refineui role each one renders.
| Part | Role |
|---|---|
root | chip |
remove | chip-remove |
States
Section titled “States”States the component styles. Component states are exposed as data attributes.
| Kind | States |
|---|---|
| Pseudo | focus-visible |
Keyboard
Section titled “Keyboard”Keys the component handles when it has focus.
| Key | Action |
|---|---|
| Enter | activate |
| Space | activate |
Reference
Section titled “Reference”- RefineUI · Tag for design guidance and token detail.
- Use in MDX and Use in Markdoc for the general rules.