Clipboard Item
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.
Anchor to propertiesProperties
- string
A unique identifier for the element.
- Anchor to texttextstringDefault: ''
Plain text to be written to the clipboard.
ClipboardItemElementProps
- id
A unique identifier for the element.
string
- text
Plain text to be written to the clipboard.
string
export interface ClipboardItemElementProps extends Pick<ClipboardItemProps$1, 'id' | 'text'> {
}
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>
examples
Code
<s-button commandFor="discount-code">Copy discount code</s-button> <s-clipboard-item id="discount-code" text="SAVE 25"></s-clipboard-item>