CopyButton
A utility button that copies a specified text to the clipboard when clicked. Often accompanied by a tooltip or visual confirmation.
A utility button that copies a specified text to the clipboard when clicked. Often accompanied by a tooltip or visual confirmation.
Basic usage example to quickly see how the CopyButton
works.
Interactive configurator to explore customization options for the CopyButton
component.
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 |
Full working code example, including necessary markup and styles. You can copy and paste this code directly to start using the component immediately.