Ark Logo
Reat
Components
Clipboard

Clipboard

A component to copy text to the clipboard

Anatomy

To set up the Clipboard correctly, you'll need to understand its anatomy and how we name its parts.

Each part includes a data-part attribute to help identify them in the DOM.

Examples

Learn how to use the Clipboard component in your project. Let's take a look at the most basic example:

Using the Root Provider

The RootProvider component provides a context for the clipboard. It accepts the value of the useClipboard hook. You can leverage it to access the component state and methods from outside the clipboard.

If you're using the RootProvider component, you don't need to use the Root component.

API Reference