Skip to content
ZikZuk UI

CodeBlock

Stripe Code

Monospace 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.

pnpm add @zikzuk/ui
import { CodeBlock, prettyJson, maskSecret } from "@zikzuk/ui";

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.

••••••••••••a1b2

When to use

  • Webhook bodies and API payloads.
  • An API key shown once — inside a warning Banner, never a toast.

Props

PropTypeDescription
contentstringThe text.
jsonunknownA value or JSON string to pretty-print; wins over content.
languagestringA small label: json, bash.
lineNumbersboolean
Default false
Number the lines.
wrapboolean
Default false
Wrap long lines instead of scrolling.
copyableboolean
Default true
Show the Copy button.
copyLabelstringNames it in the toast: “API key copied”.
secretboolean
Default false
Masked, with Show/Hide.
maxHeightstringScroll vertically past this height.
classNamestringExtra classes on the outer element.