A block that displays a value with copy-to-clipboard functionality. Supports paste via click/focus.
- API keys or tokens display
- One-time codes or passwords
- Values users need to copy or paste
titlestring— Label for the blockvaluestring(default:'') — The value to display and copyplaceholderReactNode— Placeholder when value is emptysize'small' | 'medium' | 'large'(default:'medium') — Block sizeonPaste(text: string) => void | Promise<void | string>— Callback when text is pasted into the blockonCopy() => void— Callback when the value is copied from the block
fill—#surface-2radius—1rcursor— pointerpreset—t3(switches tot2whensize="large")height—5x(4xfor small,6xfor large)
Supports Base properties.
These properties allow direct style application without using the styles prop:
- Position:
gridArea,order,gridColumn,gridRow,placeSelf,alignSelf,justifySelf,zIndex,margin,inset,position
<CopyPasteBlock title="API Key" value={apiKey} />
<CopyPasteBlock title="Token" value={token} size="small" />