CopyBox
3p-core / CopyBox
Variable: CopyBox
const
CopyBox:React.FC
<React.PropsWithChildren
<ICopyBoxProps
>>
A component that displays content and provides a copy-to-clipboard button for a given string value.
Remarks
- If
children
are provided, they will be displayed instead of thevalue
. - When the copy button is clicked, the
value
is written to the clipboard. - A visual feedback icon is shown for 2 seconds after a successful copy action.
- The copy button only appears if
value
is a non-empty string.
Examples
Minimal usage:
<CopyBox value="example@example.com" />
With custom content:
<CopyBox value="api-key-123">
<span>Your API Key</span>
</CopyBox>
Param
Component props
Param
The string value to copy to the clipboard
Param
Optional custom content to render instead of value