Tag input

Turn short text values into removable tags.

npx shadcn@latest add @silicon-ui/tag-input
fieldtags
Loading…

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/tag-input

Manually

  1. Install the dependencies.

    npm install lucide-react motion
  2. Copy these files into your project. Shared files are skipped if you already have them.

    • components/silicon-ui/tag-input/tag-input.tsx
    • components/silicon-ui/tag-input/tag-input.module.css
  3. Install the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

Source codetsx
import { TagInput } from "@/components/silicon-ui/tag-input/tag-input";

API reference

PropTypeDefault
label*string—
valuestring[]—
defaultValuestring[][]
onValueChange(value: string[]) => void—
placeholderstring"Add a tag"
descriptionstring—
idstring—

Dependencies

npm
lucide-reactmotion
Registry
silicon-motion-tokens