Documentation menu
Getting Started
Components
Primitives
- Agent Thinking
- Alert
- Alert Dialog
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Command
- Command Palette
- Context Menu
- Data Table
- Dialog
- Dropdown Menu
- Empty
- Field
- Glow Cloud
- Input
- Label
- Medication Schedule
- Period Tabs
- Popover
- Rainbow Button
- Scroll Area
- Select
- Selectable Card
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tag
- Textarea
- Timeline
- Tooltip
- Use Count Up
Charts and metrics
Patterns
- Confirm Button
- Date Picker
- Embedded
- Empty State
- Entity Drawer
- Error Boundary
- Field Row
- File Dropzone
- Form Dialog
- Kv
- List Editor
- List Page
- Live Time
- Mini Table
- Money
- Note Field
- Note Text
- Page Card
- Page Header
- Page Tabs
- Page Toolbar
- Person Cell
- Picture Field
- Print Card
- Range Switcher
- Row Actions
- Search Input
- Search Select
- Selected Box
- Signature Pad
- Status Badge
- Sub Nav Layout
- Suggest Input
- Tab Icons
- Table Footer
- Theme Accent Picker
- Time Picker
- View All Link
Dashboard cards
Advanced
Device frames
Website widgets
Website screens
Website panels
Primitives
Tag
Colored chips from the theme palette, soft or bold.
import { Tag, TAG_COLORS, type TagColor } from "@/registry/vcare/ui/tag"
export default function TagDemo() {
return (
<div className="flex max-w-xl flex-wrap justify-center gap-2">
{(Object.keys(TAG_COLORS) as TagColor[]).map((c) => (
<Tag key={c} color={c}>
{c}
</Tag>
))}
</div>
)
}Installation
npx shadcn@latest add @vcare/tagOr install directly from the URL: https://ui.vcarehms.com/r/tag.json
- Add the registry items it uses: utils.
- Copy this file into your project and change the
@/registry/vcare/…imports to your own paths.
components/ui/tag.tsx
import * as React from 'react';
import { cn } from '@/registry/vcare/lib/utils';
/** Chip palette from the design tokens (--tag-<color>-bg|border|text). Literal classes so Tailwind can see them. */
export const TAG_COLORS = {
blue: 'border-(--tag-blue-border) bg-(--tag-blue-bg) text-(--tag-blue-text)',
purple: 'border-(--tag-purple-border) bg-(--tag-purple-bg) text-(--tag-purple-text)',
green: 'border-(--tag-green-border) bg-(--tag-green-bg) text-(--tag-green-text)',
moss: 'border-(--tag-moss-border) bg-(--tag-moss-bg) text-(--tag-moss-text)',
red: 'border-(--tag-red-border) bg-(--tag-red-bg) text-(--tag-red-text)',
orange: 'border-(--tag-orange-border) bg-(--tag-orange-bg) text-(--tag-orange-text)',
amber: 'border-(--tag-amber-border) bg-(--tag-amber-bg) text-(--tag-amber-text)',
teal: 'border-(--tag-teal-border) bg-(--tag-teal-bg) text-(--tag-teal-text)',
yellow: 'border-(--tag-yellow-border) bg-(--tag-yellow-bg) text-(--tag-yellow-text)',
neutral: 'border-(--tag-neutral-border) bg-(--tag-neutral-bg) text-(--tag-neutral-text)',
} as const;
export type TagColor = keyof typeof TAG_COLORS;
/** Solid chips for deltas and counts: the soft palette's text color becomes the fill. */
export const TAG_BOLD: Record<TagColor, string> = {
blue: 'border-transparent bg-(--tag-blue-text) text-(--tag-blue-bg)',
purple: 'border-transparent bg-(--tag-purple-text) text-(--tag-purple-bg)',
green: 'border-transparent bg-(--tag-green-text) text-(--tag-green-bg)',
moss: 'border-transparent bg-(--tag-moss-text) text-(--tag-moss-bg)',
red: 'border-transparent bg-(--tag-red-text) text-(--tag-red-bg)',
orange: 'border-transparent bg-(--tag-orange-text) text-(--tag-orange-bg)',
amber: 'border-transparent bg-(--tag-amber-text) text-(--tag-amber-bg)',
teal: 'border-transparent bg-(--tag-teal-text) text-(--tag-teal-bg)',
yellow: 'border-transparent bg-(--tag-yellow-text) text-(--tag-yellow-bg)',
neutral: 'border-transparent bg-(--tag-neutral-text) text-(--tag-neutral-bg)',
};
export function Tag({
color = 'neutral',
variant = 'soft',
className,
...props
}: React.ComponentProps<'span'> & { color?: TagColor; variant?: 'soft' | 'bold' }) {
return (
<span
data-slot="tag"
className={cn(
'inline-flex h-chip shrink-0 items-center justify-center whitespace-nowrap rounded-full border px-2.5 text-xs font-semibold leading-none',
variant === 'bold' ? cn(TAG_BOLD[color], 'font-medium') : TAG_COLORS[color],
className,
)}
{...props}
/>
);
}Usage
import { TAG_COLORS, TAG_BOLD, Tag } from "@/components/ui/tag"Exports
TAG_COLORS, TAG_BOLD, Tag
Dependencies
@vcare/utils(registry)
Raw item: /r/tag.json