CopyBox
@spartanfx/react / index / 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
childrenare provided, they will be displayed instead of thevalue. - When the copy button is clicked, the
valueis written to the clipboard. - A visual feedback icon is shown for 2 seconds after a successful copy action.
- The copy button only appears if
valueis 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
props
Component props
Param
props.value
The string value to copy to the clipboard
Param
props.children
Optional custom content to render instead of value