Skip to main content

ClipboardItem

Enables copying text to the user’s clipboard. Use alongside Button or Link components to let users easily copy content. <s-clipboard-item> doesn’t render visually.

string

A unique identifier for the element.

string
Default: ''

Plain text to be written to the clipboard.

Was this section helpful?

Code

<s-button commandFor="discount-code">Copy discount code</s-button>
<s-clipboard-item id="discount-code" text="SAVE 25"></s-clipboard-item>