# Code

Syntax-highlighted code block — Shiki transformers add filename frames, line highlights, diff, focus, error/warning notation, and word highlights.

**Install:** `nimbus-docs add code`  
**Source:** `src/components/ui/code/`  
**Canonical:** https://nimbus-docs.com/components/code/

## Agent payload (JSON)

```json
{
  "slug": "code",
  "name": "Code",
  "description": "Inline / block code wrapper. Re-exports Astro's built-in <Code> (Shiki).",
  "tagline": "Syntax-highlighted code block — Shiki transformers add filename frames, line highlights, diff, focus, error/warning notation, and word highlights.",
  "install": "nimbus-docs add code",
  "sourcePath": "src/components/ui/code/",
  "canonicalUrl": "https://nimbus-docs.com/components/code/",
  "props": [
    {
      "name": "code",
      "type": "string",
      "required": true,
      "description": "Source string to highlight."
    },
    {
      "name": "lang",
      "type": "string",
      "required": true,
      "description": "Language identifier (e.g. \"ts\", \"tsx\", \"bash\")."
    },
    {
      "name": "meta",
      "type": "string",
      "required": false,
      "description": "Shiki meta — e.g. `title=\"src/foo.ts\" {1,3-5}` for filename + highlight."
    },
    {
      "name": "lineNumbers",
      "type": "boolean",
      "defaultValue": "false",
      "required": false,
      "description": "Render a gutter with line numbers."
    }
  ],
  "registryDependencies": [
    "cn"
  ],
  "dependencies": []
}
```
