Code

Code in a sentence (Code), a block of it (CodeBlock), and keys to press (Kbd).

Example

Run bun run dev, then press Ctrl C to stop.
bash
bun install
bun run dev
tsx
<Stack gap="md">
  <Text>
    Run 
    <Code>bun run dev</Code>
    , then press 
    <Kbd>Ctrl</Kbd>
     
    <Kbd>C</Kbd>
     
    to stop.
  </Text>
  <CodeBlock language="bash">bun install
bun run dev</CodeBlock>
</Stack>

Usage

Pages are built on the server: import the tags from @dash/server and return the tree. The browser runtime draws it.
tsx
import { Code, CodeBlock, Kbd, Text, Stack } from "@dash/server";

Props

CodeProps

CodeBlockProps

Prop
Type
Description
languagestring

KbdProps

PreviousText
On this page