Tag new ejectable
The Tag component is used to display tags in the sidebar or navigation bar for UI information. It supports multiple formats including common tags, SVG icons, images, and plain text.
Usage
Use via frontmatter, and it will be displayed in the sidebar or navigation bar:
Multiple tags are also supported:
You can also use it via _meta.json, for example:
The Tag component is specifically designed for display in the sidebar or navigation bar. When using in MDX content, please use the Badge component instead.
Tag types
To make it easy to pass values in frontmatter, the Tag component supports multiple tag types:
Common tags new
Some common tags are built-in and will be displayed with <Badge />. All common tags are as follows:
The Tag component is ejectable. When you want to extend common tags, you can use wrap/eject to modify the Tag component.
The following is an example of how this docsite uses wrap to add ejectable custom tag:
SVG string
You can pass an SVG string directly as the tag:
Image URL
You can use an external URL or data URL as the tag:
Plain text
Any text that doesn't match the above patterns will be displayed as a plain text Badge: