Skip to content
Harness Design System

CopyButton

The CopyButton component provides a button that copies text to the clipboard when clicked. It includes visual feedback to indicate when the text has been copied successfully.

Usage

import { CopyButton } from '@harnessio/ui/components'
return (
<CopyButton name="Text to copy" />
)

API Reference

PropRequiredDefaultType
nametruestring
classNamefalsestring
buttonVariantfalse'custom'ButtonProps['variant']
iconSizefalse16number
onClickfalse(e: MouseEvent) => void
colorfalse'white''gray' | 'white' | 'success'