Loading preview
Floating Label Input
InputsA text field whose label sits inside and floats above on focus or when filled.
Add tags with Enter or comma and remove them with Backspace or their buttons.
npx shadcn@latest add @venusui/tag-inputRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/tag-input.tsxThe code behind the preview above.
tag-input-demo.tsx
import { TagInput } from "@/components/ui/tag-input"
export default function TagInputDemo() {
return <TagInput label="Skills" defaultValue={["React", "TypeScript"]} max={6} className="max-w-sm" />
}
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | Visible label. Required. |
| value | string[] | — | Controlled tags. |
| defaultValue | string[] | [] | Initial tags when uncontrolled. |
| onValueChange | (tags: string[]) => void | — | Called when tags change. |
| max | number | — | Maximum number of tags. |
| placeholder | string | "Add a tag…" | Input placeholder. |
Only the props above, plus className.
lucide-react, React 19 and Tailwind CSS v4.add in the file for other rules.onChange if tags may contain commas.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A text field whose label sits inside and floats above on focus or when filled.
A number field with minus and plus buttons, clamped to a range.
One-time code entry in separate boxes with paste, autofill and keyboard navigation.