Tags
Filter products by
Last updated
Filter products by
Last updated
Component: and related tag components
Path: /components/shared/tag-selector.tsx
Import:
A tag system that lets you categorize and filter products. Tags are colored badges that you can click to select/deselect.
TagSelector:
Props:
selectedTags: string[] - Currently selected tag slugs
onChange: (tags: string[]) => void - Called when tags are selected/deselected
Features:
Shows tags as clickable colored badges
Switches to dropdown if you have more than 10 tags
Shows loading spinner while fetching tags
ProductTags:
import { ProductTags } from "@/components/shared/product-tags";
Props:
tags
: ExtendedProductTag[] - Tags to display
limit?: number
- How many tags to show (default: 3)
showAll?: boolean
- Show all tags instead of limiting
Features:
Shows tags on product cards
Shows "+X more" if there are hidden tags
Clicking tag navigates to tag page
Admin Management:
Path: /dashboard/admin/tags
Features:
Create tags with custom colors
Edit existing tags
Assign tags to products
Delete tags
Example usage in main-layout.tsx: