apps/www/content/docs/components/clipboard.mdx
import { Clipboard } from "@chakra-ui/react"
<Clipboard.Root>
<Clipboard.Trigger>
<Clipboard.CopyText />
<Clipboard.Indicator />
</Clipboard.Trigger>
<Clipboard.Input />
</Clipboard.Root>
Use the Clipboard.Trigger component to create a copy button.
Use the Clipboard.Input component to create a copy input.
Use the timeout prop to change the duration of the copy message.
Here's an example that combines the Clipboard.Trigger and
Clipboard.ValueText components to create a link appearance.
Alternatively, you can use the useClipboard hook to create a custom component.
Explore the Clipboard component parts interactively. Click on parts in the
sidebar to highlight them in the preview.