Park UI

Clipboard

A button component for copying content to the user's clipboard.

Installation

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

PropDefaultType
timeout3000
number

The timeout for the copy operation

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

defaultValue
string

The initial value to be copied to the clipboard when rendered. Use when you don't need to control the value of the clipboard.

id
string

The 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) => void

The function to be called when the value is copied to the clipboard

onValueChange
(details: ValueChangeDetails) => void

The function to be called when the value changes

value
string

The controlled value of the clipboard

Indicator

PropDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

copied
React.ReactNode