Skip to Content
DocsResourcesPricingShowcase

Clipboard

Used to copy text to the clipboard

SourceStorybookRecipeArk

import { Clipboard } from '@saas-ui/react/clipboard'
<Clipboard.Root value="...">
  <Clipboard.Button />
  <Clipboard.IconButton />
  <Clipboard.Input />
</ClipboardRoot>

Use the Clipboard.Button or Clipboard.IconButton components to create a copy button.

Use the copied prop to change the label when the text is copied.

Use the Clipboard.Input component to create a copy input.

Use the timeout prop to change the duration of the copy message.

PropDefaultType
timeout '3000'
number

The timeout for the copy operation

asChild
boolean

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

For more details, read our Composition guide.
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

value
string

The value to be copied to the clipboard

Previous

Checkbox

Next

Close Button