Add reusable tags component for document and blog metadata
enhancement
### What problem will this feature address?
Fumadocs currently exposes `TagsList` and `TagsListItem` under `fumadocs-ui/components/dialog/search`, but those components are specific to search filtering.
They render buttons, depend on selected filter state, and require `onTagChange`, so they are not a good fit for rendering static metadata tags from MDX/frontmatter on docs pages, blog posts, or tag archive pages.
Users who store tags in frontmatter currently need to build their own tag UI to display tags, link to tag pages, show an active tag, or render post counts while matching Fumadocs UI styling.
### Describe the solution you'd like
Add a small reusable tags component to `fumadocs-ui`, exported from:
```ts
fumadocs-ui/components/tags
```
The component would provide:
TagList for wrapping and laying out tags
Tag for rendering a single tag as either a link or plain text
optional active state
optional count
Fumadocs theme token styling
no search-specific state or client-side behavior
Example:
```tsx
import { Tag, TagList } from 'fumadocs-ui/components/tags';
<TagList>
{page.data.tags.map((tag) => (
<Tag key={tag} href={`/tags/${encodeURIComponent(tag)}`}>
{tag}
</Tag>
))}
</TagList>
```
### Describe alternatives you've considered
A workaround is to build custom tag components in each app using Tailwind classes.
Another option is to reuse `TagsList` from `fumadocs-ui/components/dialog/search`, but that component is tied to search filter behavior and renders buttons instead of generic link/span primitives.
A more complete tag system, such as automatic frontmatter extraction or tag archive route generation, would be larger in scope. A small UI primitive keeps this reusable without introducing routing or content-source assumptions.
### Additional context
This is intended as a small UI primitive, not a full tag archive system.
It would help users render document/blog metadata tags consistently with Fumadocs UI while keeping search filter tags separate from static metadata tags.
关闭于 2026-05-22 4 条评论