TagList
A post's tags as a wrapping row of links to each tag's page, every one led by a prefix such as #.
View code
import { TagList } from "@sdxc/ui/blog";
let tags = [
{ label: "caching", href: "/tags/caching" },
{ label: "http", href: "/tags/http" },
{ label: "edge", href: "/tags/edge" },
{ label: "performance", href: "/tags/performance" },
];
<TagList>
{tags.map((tag) => <TagList.Tag href={tag.href}>{tag.label}</TagList.Tag>)}
</TagList>
<TagList prefix="" aria-label="Topics">
{tags.map((tag) => <TagList.Tag href={tag.href}>{tag.label}</TagList.Tag>)}
</TagList>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { TagList } from "@sdxc/ui/blog";Renders the tags as a <ul> that wraps onto as many lines as it needs, each tag kept whole
on its line; a list with no tags renders nothing. Turn the links into chips or join them
with a separator through TagList.CustomProperties.
Composition
The parts the component publishes, each a static property of the host.
TagListTagList.TagOne tag as a list item holding its link, the list's prefix set before the label and hidden from assistive technology.
Examples
<TagList prefix="" aria-label="Topics">…</TagList><TagList style={{ "--ui-tag-list-separator": '","' }}>…</TagList>Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
prefix | string | — | No | Set before every tag's label and hidden from assistive technology; an empty string shows the bare names. |
"aria-label" | string | — | No | The list's accessible name. |
children | RemixNode | — | No | The list's TagList.Tag parts. |
Also accepts everything in TagPropsOf<"ul">.