Skip to content
Page

Tag

Categorization tag or filter chip. Alias of Chip.

DefaultOutlineFilledRemovable
import { Tag } from "@pelagornis/page/components";

The preview above renders this file. Copy it into src/components/ to start from it.

src/components/TagExample.tsx
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>
);
}

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.

src/content/docs/example.mdx
---
title: Example
---
import { Tag } from "@pelagornis/page/components";
<Tag variant="outline">Draft</Tag>
<Tag variant="filled">Published</Tag>

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.

src/content/docs/example.mdoc
{% tag variant="outline" %}Draft{% /tag %}
{% tag variant="filled" %}Published{% /tag %}

Attributes use the same names and values as the React props.

Values the component accepts for each variant prop.

PropValues
variantdefault outline filled
sizesm md lg

Parts of the component and the data-refineui role each one renders.

PartRole
rootchip
removechip-remove

States the component styles. Component states are exposed as data attributes.

KindStates
Pseudofocus-visible

Keys the component handles when it has focus.

KeyAction
Enteractivate
Spaceactivate