Installation
Add Component
Copy the code snippet below into you components folder.
Integrate Recipe
Integrate this recipe in to your Panda config.
Usage
Examples
Button
Use the Clipboard.Trigger component to create a copy button.
Input
Use the Clipboard.Input component to create a copy input.
Timeout
Use the timeout prop to set the duration of the copied state.
Props
Root
| Prop | Default | Type | 
|---|---|---|
| timeout | 3000 | numberThe timeout for the copy operation | 
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | |
| defaultValue | stringThe initial value to be copied to the clipboard when rendered. Use when you don't need to control the value of the clipboard. | |
| id | stringThe unique identifier of the machine. | |
| ids | Partial<{ root: string; input: string; label: string }>The ids of the elements in the clipboard. Useful for composition. | |
| onStatusChange | (details: CopyStatusDetails) => voidThe function to be called when the value is copied to the clipboard | |
| onValueChange | (details: ValueChangeDetails) => voidThe function to be called when the value changes | |
| value | stringThe controlled value of the clipboard | 
Indicator
| Prop | Default | Type | 
|---|---|---|
| asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. | |
| copied | React.ReactNode |