CopyButton
A utility button that copies a specified text to the clipboard when clicked. Often accompanied by a tooltip or visual confirmation.
Usage
Basic usage example to quickly see how the CopyButton
works.
Properties
Interactive configurator to explore customization options for the CopyButton
component.
Timeout
API References
Props API
Props API | Type | Default | Annotation |
---|---|---|---|
children? | (payload: { copied: boolean; copy: () => void }) => React.ReactNode | Children callback, provides current status and copy function as an argument | |
value? | string | Value that will be copied to the clipboard when the button is clicked | |
timeout? | number | 1000 | Copied status timeout in ms |
Source Codes
Full working code example, including necessary markup and styles. You can copy and paste this code directly to start using the component immediately.