A button that copies text to the clipboard.

Usage

Wrap text in <orb-copy-button> to copy it to the clipboard. Set the value attribute to copy something other than the text content.

npm install orb-style

Token: sk_test_example_123

xs sm md lg

<p>
  <orb-copy-button>npm install orb-style</orb-copy-button>
</p>
<p>
  <orb-copy-button value="sk_test_example_123" label="Copy token">Token: sk_test_example_123</orb-copy-button>
</p>
<p>
  <orb-copy-button size="xs" value="xs">xs</orb-copy-button>
  <orb-copy-button size="sm" value="sm">sm</orb-copy-button>
  <orb-copy-button size="md" value="md">md</orb-copy-button>
  <orb-copy-button size="lg" value="lg">lg</orb-copy-button>
</p>

Properties

label

Description Accessible label for the button.
Attribute label
Type string
Default "Copy"

size

Attribute size
Type "lg" | "md" | "sm" | "xs"
Default "sm"

value

Description The text to copy. Falls back to the element’s text content when omitted, which is how it behaves when wrapped around the content it copies.
Attribute value
Type string
Default undefined

Dependencies

Depends on

Graph

graph TD; orb-copy-button --> orb-button orb-button --> orb-loading style orb-copy-button fill:#f9f,stroke:#333,stroke-width:4px