Inline code
A literal in running text: a name to type, an identifier, a key. Cut to one line in the Kbd's box, it sits beside the Copy button for a value to paste.
To continue, type acme-prod below.
https://gateway.dome.example/gateways/3f2b9c1e-7a44-4d0b-9e61-2c8f5d0a1b77<p> To continue, type <InlineCode>acme-prod</InlineCode> below.</p> <InlineCode truncate>{gateway.endpoints.gatewayUrl}</InlineCode><CopyButton boxed value={gateway.endpoints.gatewayUrl} label="Copy endpoint" />Installation
import { InlineCode } from "@catalog-developer/components/inline-code";
import { CopyButton } from "@catalog-developer/components/copy-button";
// In a table's cell:
import { TableCodeCopy, TableCopyButton, TableInlineCode } from "@catalog-developer/components/table";What it is
A literal, in mono on the Kbd's fill. In a sentence it flows with the text. With truncate it is one line in the Kbd's box (its fill, its 5px corners, its 20px height; the Kbd has no edge, so this has none), cut where its room ends.
A value to paste is that box and the Copy button boxed beside it: two components, the code and its copy, so a cut value and its copy read as one and two. The gray pill that tables show today is another control, outside the design system (CopyableText).
acme-prodWith its copysk_live_8f2c41d09b7eWhich one to use
Each has one job.
| What it is | Use | Why |
|---|---|---|
| A literal the reader reads or types | InlineCode | It sits in the sentence and wraps with it. |
| A figure or a name that must stand out in a sentence | InlineCode mono={false} | The same box, in the sentence's own typeface: it is not code. |
| A value the reader will paste: an endpoint, an id, a key | InlineCode truncate and CopyButton boxed | The value and its copy, two boxes 4px apart. |
| The same, in a table cell | TableCodeCopy with TableInlineCode and TableCopyButton | The copy button there is the row's own: its icon alone, shown with its row. |
| A code in a table cell, nothing to paste | TableInlineCode | A cell is one line: the value is cut. |
| Something to copy that is not shown: an entity's ID, from its page's header | CopyButton | Nothing is shown to put in a box. |
| A value in a form, or a secret to show and hide | Input readOnly, with copyable or revealable | A field shows the whole value, and has the eye for a secret. |
| A key to press | Kbd | A key is not a value. |
Is it a key to press (⌘K)?
├── Yes → Kbd
└── No
├── Is it in a form, or a secret to show and hide?
│ └── Yes → Input, readOnly, with copyable or revealable
├── Is the thing to copy not shown (an entity's ID, from its page's header)?
│ └── Yes → CopyButton
├── Will the reader paste it (an endpoint, an id, a key)?
│ ├── In a table cell → TableCodeCopy: TableInlineCode + TableCopyButton
│ └── Otherwise → InlineCode truncate + CopyButton boxed, 4px apart
├── Is it in a table cell?
│ └── Yes → TableInlineCode
├── Must it stay on one line?
│ └── Yes → InlineCode truncate
├── Is it a figure or a name in a sentence, not code?
│ └── Yes → InlineCode mono={false}
└── Default (a literal to read or to type) → InlineCodeAnatomy
sk_live_8f2c41d09b7e- 1 — The Inline code. The Kbd's fill, 5px corners, 20px tall, 5px either side. The value is cut with “…”; a drag selects it.
- 2 — The Copy button, boxed. A 20px square in the same fill, 4px after the code. A 12px icon, 4px around it.
In a sentence
A literal the reader reads or types. It is monospace, 1px under the text beside it (12px in 13px text), on the Kbd's fill, with 4px corners. It flows with the sentence: a line break carries its box to both lines, and it does not make a 20px line taller.
To continue, type acme-prod below.
<p> To continue, type <InlineCode>acme-prod</InlineCode> below.</p>On one line
truncate draws the value in the Kbd's box, 20px tall with 5px corners, with 5px either side, on one line. Where its room ends the value is cut with “…”, and only then does the pointer or the focus show the whole value in a tooltip. The value stays text: it can be selected, and a click on it does nothing. The box has no width of its own: its parent sets it (in a table, the column). The example sits in a box 280px wide.
https://gateway.dome.example/gateways/3f2b9c1e-7a44-4d0b-9e61-2c8f5d0a1b77<InlineCode truncate>{gateway.endpoints.gatewayUrl}</InlineCode>A value to paste
A value the reader will paste (an endpoint, an id, a key) is two components side by side, 4px apart: the Inline code, cut to its room, and the Copy button, boxed: a 20px square in the same fill, with the same corners. Neither holds the other. The Copy button is never cut; under the pointer the ghost Button's hover tint lies over its fill and its icon turns full color; its tooltip says what it copies (“Copy key”), then “Copied” once the value is on the clipboard, and its cursor is the arrow: the pointing hand is for what goes to another page.
The key is shown once: sk_live_8f2c41d09b7e
<p> The key is shown once:{" "} <span className="inline-flex max-w-full min-w-0 items-center gap-1 align-baseline"> <InlineCode truncate>{key}</InlineCode> <CopyButton boxed value={key} label="Copy key" /> </span></p>In a table cell
In a row, TableCodeCopy places the code and the row's own copy button, TableCopyButton: the link one, not the boxed one. It is its icon alone, gray, with no box and no fill, and the full text color under its pointer; 6px round it take the click and show nothing (24px in all). They sit 6px apart, both above the row's link, so a click on them is their own. The button shows while its row is under the pointer or holds the keyboard's focus, as every copy button in a row does, and keeps its place while it does not: the code is cut to what the button leaves and never moves when the pointer comes. Under 42px of room, in a column a person narrowed by hand, the button goes and the code takes the room. In a cell the code is TableInlineCode, which sets secondaryitself: the color of the table's values, its fill still setting it apart. The tooltip says “Copy” and nothing more; a screen reader still hears what and which row, from the button's aria-label (“Copy endpoint for Default gateway”). A code with nothing to paste is TableInlineCode alone. The Endpoint column here is 240px wide.
{ id: "endpoint", header: "Endpoint", width: 240, cell: (row) => ( <TableCodeCopy> <TableInlineCode>{row.endpoint}</TableInlineCode> <TableCopyButton value={row.endpoint} label="Copy" aria-label={`Copy endpoint for ${row.name}`} /> </TableCodeCopy> ),}Secondary text color
secondary sets the value in the secondary text color, the color of a table's values. In a table cell TableInlineCode sets it already. Off, the default, the value is the full text color, for a code in a sentence or a row of its own.
acme-prodacme-prod<InlineCode truncate>acme-prod</InlineCode><InlineCode truncate secondary>acme-prod</InlineCode>A figure or a name, not code
mono off is the same box around text that is not code: a figure or a name that must stand out in a sentence. It is a span, not a code. Only the typeface changes: the sentence's in place of the mono one. It is the sentence's own size (the one-pixel step exists only because mono reads larger), and it takes its weight from where it sits: regular in a body sentence, medium when written as a label, as the figures and names of Home's Activity sentences are. No prop picks the weight.
3,032 tool calls. The busiest hour was 1 PM.
3,032 tool calls. The busiest hour was 1 PM.
// Regular: it sits in the sentence's body text.<p className="text-body-2"> <InlineCode mono={false}>3,032</InlineCode> tool calls. The busiest hour was <InlineCode mono={false}>1 PM</InlineCode>.</p> // Medium: the figure is written as a label, and the box takes it.<p className="text-body-2"> <span className="text-label-2"><InlineCode mono={false}>3,032</InlineCode></span> tool calls. The busiest hour was{" "} <span className="text-label-2"><InlineCode mono={false}>1 PM</InlineCode></span>.</p>A long value that wraps
Without truncate a long value wraps with the sentence, and breaks anywhere. The example sits in a box 280px wide.
https://gateway.dome.example/gateways/3f2b9c1e-7a44-4d0b-9e61-2c8f5d0a1b77.<p> The gateway answers at <InlineCode>{gateway.endpoints.gatewayUrl}</InlineCode>.</p>Keyboard and screen reader
| Key | Does |
|---|---|
Tab | A cut code is a stop: its focus shows the whole value. Then the Copy button, whose focus shows its tooltip. |
Enter, Space | On the Copy button: copies the value. The tooltip says “Copied”. |
A screen reader reads the value, then a button named “Copy endpoint”. Once the value is on the clipboard the button is named “Copied” for 2 seconds, and a status beside it says “Copied”, so the change is read out. If the browser refuses the clipboard, nothing changes: the button never says “Copied” for a value that was not copied.
In the dashboard
A name to type
39 inline codes in 18 files: the name to type in a confirm dialog, an identifier in a sentence, a claim in a rule.
app/(authenticated)/[kind]/[scopeId]/settings/danger-zone/page.tsx
The older copy control
34 uses in 23 files of an older control that is not in the design system: 31 draw a gray pill that copies on a click anywhere, 3 a bordered chip that says ID. No screen on main uses the two components yet.
components/shared/copyable-text.tsx
API Reference
InlineCode
Besides these, the props of a <code>. The Copy button's boxed is on its own page.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | The value. |
truncate | boolean | false | One line in the Kbd's 20px box, cut with “…” where its room ends; the whole value in a tooltip only when it is cut. Off, a long value wraps with the sentence. |
secondary | boolean | false | The value in the secondary text color (--neutral-fg-secondary), the color of a table's values (TableInlineCode sets it in a cell). Off, the full text color. |
mono | boolean | true | Off, the box holds text that is not code (a figure, a name in a sentence), in a span. It takes the typeface, the size and the weight of the text it sits in: regular in body text, medium inside a label. |
className | string | — | Styles the code. |
In a table
| Prop | Type | Default | Description |
|---|---|---|---|
TableInlineCode | InlineCodeProps | — | The Inline code with truncate, relative z-10 like the Table's other cell pieces, and secondary: the table's secondary text color (table rule T1). |
TableCodeCopy | ComponentProps<"span"> | — | Places its two children, a TableInlineCode and a TableCopyButton, 6px apart, above the row's link: the code cut to what the button leaves, and under 42px of room the button gone. It draws nothing of its own. |
Tokens
In ds/tokens/inline-code.css. The colors and the size follow other tokens, so dark mode needs no line of its own. The cut form's corners and height are the Kbd's at its md size (5px, 20px), as classes in inline-code.tsx; its room either side is its own token. The boxed Copy button takes the same fill, with the ghost Button's --hover tint over it under the pointer.
| Token | Value | What it sets |
|---|---|---|
--inline-code-background | The Kbd's fill | The box's fill, and the boxed Copy button's. |
--inline-code-foreground-text | The text color | The value. |
--inline-code-secondary-foreground-text | The secondary text color | The value with secondary: in a table cell. |
--inline-code-font-size | 1px under the text beside it, never under 10px | The value's size: 12px beside 13px text. |
--inline-code-padding-inline | 5px | The cut form's room either side of the value. |
Rules
Written down
Type acme-prod below
Type acme-prod below
Mono is 1px under the text beside it
Mono reads larger than the text beside it at the same size. So an inline code is 12px beside 13px text and 11px beside 12px text, the sizes of body-mono-3 and body-mono-4. It does this by itself: a screen sets no size on it. Beside 15px text it is 14px, which is not a size of the type scale.
From ui/ds/README.md (Layers, Type roles).
https://gateway.dome.example/gateways/3f2b9c1e-7a44-4d0b-9e61-2c8f5d0a1b77https://gateway.dome.example/gateways/3f2b9c1e-7a44-4d0b-9e61-2c8f5d0a1b77A value and its copy are two components
“One is a truncated element and the other is a copy, because it's not really working together.” Neither holds the other, and neither has a prop that brings in the other's behavior.
From The designer, 2026-11-17.
A control at a box's edge has equal space around it
The boxed Copy button's icon has 4px above it, 4px at each side and 4px below it.
From .claude/rules/dashboard-ui.md (rule 9).
An icon takes the size its component sets
The rule: an icon is 14px unless its component sets another size, and is never shrunk to look lighter. Here the component is the Copy button, which sets 12px when it is boxed.
From .claude/rules/dashboard-ui.md (rule 4).
Screens are built from the shared components
A screen does not style a span into a code or a chip: it uses these components.
From .claude/rules/dashboard-ui.md (rule 1).
Open questions
Is a value copy-on-click?
OpenNo. Only the Copy button copies; the value can be selected, and a click on it does nothing (the designer, 2026-11-17).
design/principles.md (7. Permissions, Scope, and Identity): identifiers render in mono and are copy-on-click.
Does a copy also show a toast?
OpenNo. The check and the “Copied” tooltip answer where the click was.
design/principles.md (Toasts) lists copy-to-clipboard among what triggers a toast.
Do the three audit headers keep their chip that says ID?
OpenNo: they take the Copy button alone, as a detail page's header has.
Keep a chip that says ID. The Copy button shows an icon only: the chip would need a Copy button with a word on it.