Homelogologo
Sponsor

Clipboard

Copies text to the clipboard

Usage

Use the Clipboard to let users copy text (e.g., a code snippet or token) to their clipboard.

import { Clipboard } from "@elemnts-ui/react" <Clipboard value="Hello, World!"> <Clipboard.Trigger> <Clipboard.Indicator /> </Clipboard.Trigger> <Clipboard.Input /> </Clipboard>

Input

Use ClipboardInput to render an input field that contains the text to be copied.

Timeout

Control how long the copied state remains active before resetting by configuring a timeout.

API Reference

Clipboard

Manages the clipboard state and value.

PropTypeDefault
valuestring-
timeoutnumber2000

ClipboardTrigger

Renders a trigger button for copying text to the clipboard.

PropTypeDefault
asChildbooleanfalse

ClipboardInput

Renders an input field that contains the text to be copied.

PropTypeDefault
asChildbooleanfalse

ClipboardIndicator

Renders an indicator that shows the copied state.

PropTypeDefault
asChildbooleanfalse
copiedbooleanfalse

ClipboardValue

Renders the value of the clipboard.

PropTypeDefault
asChildbooleanfalse