/// Typography
Code
Inline code — mono on a sunken surface with a subtle hairline.
import { Code } from "@protocore/pds";Basics
Code renders a <code> element on a sunken surface with a hairline border — for a literal token inside a sentence.
Call endpoint.send(dstEid, message) to dispatch a cross-chain packet.
Inline in prose
Wrap individual identifiers, values, or field names as they appear in running text; each keeps the mono family and the sunken chip.
Set the confirmations field on your DVNConfig to raise the security threshold; the default is 15.
When to use it
Use Code for a short literal that appears *inside* prose — a function name, a config key, a value, a path. It signals "this is exactly as typed."
For a multi-line snippet, a command, or anything the reader might copy wholesale, use CodeBlock, which gives you a panel with an optional title bar and comment/literal styling. For a *keyboard shortcut* rather than code, use Kbd, which renders a raised key-cap instead of a sunken chip. Code is strictly the inline case.
Guidelines
Do
- Use `Code` for inline literals — identifiers, keys, values, paths.
- Keep the contents to a single short token or expression.
- Nest it inside `Text` so it inherits the paragraph flow.
- Use it for the exact-as-typed spelling of a thing.
Don't
- Don't use it for multi-line snippets — that is `CodeBlock`.
- Don't use it for keyboard shortcuts — that is `Kbd`.
- Don't wrap prose or emphasis in it; it means "literal code."
- Don't nest a `Code` inside another `Code`.
Accessibility
- Renders a semantic `<code>` element, correctly conveying inline code to assistive tech.
- The sunken surface and mono family are the visual cue; the semantics don't depend on colour.
- Contents are selectable and copyable as normal inline text.
Code props
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | |
style | CSSProperties | — |