Components
- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/clipboard.json
Usage
import { Clipboard, ClipboardTrigger, ClipboardIndicator } from "@/components/ui/clipboard";
<Clipboard value="https://x.com/vinihvc"> <ClipboardTrigger> <ClipboardIndicator /> </ClipboardTrigger> </Clipboard>
Controlled
Use the onStatusChange prop to control the clipboard value programmatically.
Examples
Icon Only
Different Icons
Use the copied prop on <ClipboardIndicator /> to customize the icon shown when copied.
Add a children to the <ClipboardIndicator /> to customize the icon shown when not copied.
Value Text
Use <ClipboardValue /> to display the value as text instead of an input field.
https://x.com/vinihvc
Custom Timeout
Use the timeout prop on <Clipboard /> to customize how long the copied state is shown.
API Reference
Clipboard
Root wrapper. Manages copy state and value.
| Prop | Type | Default |
|---|---|---|
value | string | required |
timeout | number | 2000 |
onStatusChange | ({ copied }: StatusChangeDetails) => void | - |
className | string | - |
ClipboardTrigger
Triggers copy to clipboard on click.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
ClipboardInput
Input showing the value to copy. Often hidden or read-only.
| Prop | Type | Default |
|---|---|---|
className | string | - |
ClipboardIndicator
Icon that changes based on copy state (e.g. copy vs check).
| Prop | Type | Default |
|---|---|---|
copied | ReactNode | <CheckIcon /> |
className | string | - |
asChild | boolean | false |
ClipboardValue
Text display of the value. Use when input is not needed.
| Prop | Type | Default |
|---|---|---|
size | "xs", "sm", "md", "lg", "xl" | "md" |
className | string | - |
asChild | boolean | false |
For a complete list of props, see the Ark UI documentation.