Components · Data Display
InlineCode
A name from code inside a sentence — a variable, a key, a file name — set in Space Mono on a sunken fill.
import { InlineCode } from "@botiverse/raft-ui";A piece of code inside running text: a variable, a key or a file name, such as RAFT_TOKEN or raft.config.ts. It stays part of the sentence. For a command people copy, use CopyableCode; for several lines, use CodeBlock.
When to use
Anatomy
InlineCode: acodeelement. Its text is the code.
Variants
Content
- Write the code exactly as it is typed, with its own casing.
- Don't put a whole command in it. A command people run goes in CopyableCode.
Rules
- Set inline code in Space Mono at 0.875 times the size of the text around it, so a run of code doesn't crowd the sentence.
- Put it on
fill-mutedwithradius-stickerand no border.
API
InlineCode
Also takes the attributes of its element.
Related
Changes
- 0.9.3 · Fixed
InlineCodein a message centres its letters in the fill (they sat about 0.6px low).