CodeBlock
Stripe CodeMonospace text on a muted surface with a Copy button that confirms with a toast. json pretty-prints a value or a JSON string; secret starts masked (••••a1b2) with Show/Hide while Copy still copies the real value. Long lines scroll unless you ask them to wrap.
A JSON payload
json
{ "event": "payment.success", "data": { "id": "pay_8f2k1x", "amount": 125000, "currency": "INR" }}A secret shown once
Copy your API key now
You won't see it again after you leave this page.
••••••••••••a1b2When to use
- Webhook bodies and API payloads.
- An API key shown once — inside a warning Banner, never a toast.
Props
| Prop | Type | Description |
|---|---|---|
| content | string | The text. |
| json | unknown | A value or JSON string to pretty-print; wins over content. |
| language | string | A small label: json, bash. |
| lineNumbers | boolean Default false | Number the lines. |
| wrap | boolean Default false | Wrap long lines instead of scrolling. |
| copyable | boolean Default true | Show the Copy button. |
| copyLabel | string | Names it in the toast: “API key copied”. |
| secret | boolean Default false | Masked, with Show/Hide. |
| maxHeight | string | Scroll vertically past this height. |
| className | string | Extra classes on the outer element. |