Componentform0.4 KB gzipZero dependencies
CopyChip
Small mono chip that copies to clipboard with check morph and 'COPIED' feedback
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add copy-chipOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CopyChip } from "@/components/ui/copy-chip" <CopyChip value="Hello Big Bull UI" label="Copy" />Source code
copy-chip.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxcopy-chip.tsx40 lines
"use client";import { cn } from "./lib/utils";import { useCopy } from "./lib/hooks"; export type CopyChipProps = { value: string; label?: string;}; const CopyChip = ({ value, label = "COPY" }: CopyChipProps) => { const { copied, copy } = useCopy(); return ( <div className={cn( "inline-flex items-center gap-2 rounded-md border border-border bg-background p-2", "animate-[stampIn_0.2s_ease-out_both]",Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { CopyChip } from "@/components/ui/copy-chip"; <CopyChip />| Prop | Type | Description |
|---|---|---|
| value | string | The text value to copy to clipboard |
| label | string | Label text for the copy button |