Skip to content

Browse components

← All components

Tag

Selectable or dismissible tag. Use inside TagGroup for selection.

Install
npx shadcn@latest add https://ui.anuragroy.dev/r/tag.json

Preview

Loading preview…

Installation

Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.

Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/tag.json

GitHub fallback if the website is down:

Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/tag.json

Usage

Import paths follow your components.json aliases. After install, the default path is @/components/ui/tag.

Import
import { Tag } from "@/components/ui/tag"
example.tsx
import { Tag } from "@/components/ui/tag"import { TagGroup } from "@/components/ui/tag-group"export function Example() {  return (    <TagGroup label="Topics" selectionMode="multiple" defaultValue={["react"]}>      <Tag value="react" removable>React</Tag>      <Tag value="vue" removable>Vue</Tag>    </TagGroup>  )}

API Reference

Tag

PropTypeDefault
valuestring—
variant"primary" | "outline" | "soft""primary"
removableboolean—
removeLabelstring"Remove"
disabledboolean—
  • value — Required selection key.