# Code An inline code component for displaying short code snippets or technical terms within running text. Renders as a styled `` element with monospace typography. ```tsx demo import { Code } from "@tenstorrent/vesper/code"; import { Typography } from "@tenstorrent/vesper/typography"; export default function CodeDemo() { return ( Use the Code component to highlight inline code. ); } ``` ## Options | Prop | Type | Description | Default | | ---------- | ------------------------- | ----------------------------------- | ----------- | | `variant` | `"default" \| "contrast"` | The visual style variant to render. | `"default"` | | `children` | `ReactNode` | The inline code content. | — | Any additional props are forwarded to the underlying `` element. ## Examples ### Basic usage Use `` as you would use the `` element by wrapping inline code strings: ```tsx demo import { Code } from "@tenstorrent/vesper/code"; import { Typography } from "@tenstorrent/vesper/typography"; export default function BasicCode() { return ( Run yarn install to get started. ); } ``` ### Variants `Code` can be rendered in one of two variants: `"default"` or `"contrast"`. Use the `"contrast"` variant to render inline `Code` with increased contrast: ```tsx demo import { Code } from "@tenstorrent/vesper/code"; import { Typography } from "@tenstorrent/vesper/typography"; export default function CodeVariants() { return (
Run yarn install to get started. Run yarn install to get started.
); } ```