{
  "name": "Code",
  "category": "Typography",
  "subcategory": null,
  "description": "Inline or block monospace code snippet with optional copy button.",
  "thumbnail": "/preview-cards/code.png",
  "hasDocsPage": true,
  "nugetPackage": "Lumeo",
  "files": [
    "UI/Code/Code.razor"
  ],
  "dependencies": [],
  "packageDependencies": [],
  "cssVars": [
    "--color-muted",
    "--radius"
  ],
  "api": {
    "name": "Code",
    "category": "Typography",
    "subcategory": null,
    "description": "Inline or block monospace code snippet with optional copy button.",
    "nugetPackage": "Lumeo",
    "files": [
      "UI/Code/Code.razor"
    ],
    "namespace": "Lumeo",
    "inheritsFrom": null,
    "implements": [],
    "parameters": [
      {
        "name": "Variant",
        "type": "string",
        "default": "\"inline\"",
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Size",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "ChildContent",
        "type": "RenderFragment?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "Class",
        "type": "string?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": false
      },
      {
        "name": "AdditionalAttributes",
        "type": "Dictionary<string, object>?",
        "default": null,
        "description": null,
        "isCascading": false,
        "captureUnmatched": true
      }
    ],
    "events": [],
    "enums": [],
    "records": [],
    "cssVars": [
      "--color-muted",
      "--radius"
    ],
    "examples": [
      {
        "title": "Inline",
        "code": "<p>\n    Use the <Code>Code</Code> component to style inline code.\n    Pass <Code>Variant=\"block\"</Code> for multi-line blocks.\n</p>"
      },
      {
        "title": "Block",
        "code": "<Code Variant=\"block\">dotnet add package Lumeo --version 2.1.0</Code>"
      },
      {
        "title": "Custom Size",
        "code": "<Code Size=\"xs\">text-xs code</Code>\n<Code Size=\"base\">text-base code</Code>\n<Code Size=\"lg\">text-lg code</Code>"
      },
      {
        "title": "Variant — interactive",
        "code": "@* inline — pill-styled within text *@\n<Code Variant=\"inline\">dotnet add package Lumeo</Code>\n\n@* block — full-width scrollable code block *@\n<Code Variant=\"block\">dotnet add package Lumeo</Code>"
      }
    ],
    "subComponents": {},
    "parseFailed": false,
    "parseError": null
  },
  "$schema": "https://lumeo.nativ.sh/registry-component-schema.json",
  "key": "code",
  "docsUrl": "https://lumeo.nativ.sh/components/code",
  "sourceUrl": [
    {
      "file": "UI/Code/Code.razor",
      "url": "https://github.com/Brain2k-0005/Lumeo/tree/master/src/Lumeo/UI/Code/Code.razor"
    }
  ],
  "source": [
    {
      "path": "UI/Code/Code.razor",
      "content": "@namespace Lumeo\n\n<code class=\"@CssClass\" @attributes=\"AdditionalAttributes\">@ChildContent</code>\n\n@code {\n    [Parameter] public string Variant { get; set; } = \"inline\";\n    [Parameter] public string? Size { get; set; }\n    [Parameter] public RenderFragment? ChildContent { get; set; }\n    [Parameter] public string? Class { get; set; }\n    [Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? AdditionalAttributes { get; set; }\n\n    private string BaseClasses => Variant switch\n    {\n        \"block\" => \"block rounded-lg bg-muted p-4 font-mono text-sm overflow-x-auto\",\n        _ => \"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold\"\n    };\n\n    private string CssClass\n    {\n        get\n        {\n            var classes = new List<string> { BaseClasses };\n\n            if (!string.IsNullOrEmpty(Size))\n                classes.Add($\"text-{Size}\");\n\n            if (!string.IsNullOrEmpty(Class))\n                classes.Add(Class);\n\n            return string.Join(\" \", classes);\n        }\n    }\n}\n"
    }
  ],
  "slots": [
    {
      "name": "ChildContent",
      "owner": "Code",
      "type": "RenderFragment?",
      "description": null
    }
  ],
  "serviceDependencies": [],
  "cascadingDependencies": [],
  "relatedComponents": [],
  "keyboardInteractions": [],
  "tests": [
    "tests/Lumeo.Tests/Components/Code/CodeTests.cs"
  ],
  "mdSummary": "# Code\n\nInline or block monospace code snippet with optional copy button.\n\n**Package:** `Lumeo` · **Category:** Typography\n**Docs:** https://lumeo.nativ.sh/components/code\n\n## Parameters\n| Owner | Name | Type | Default | Description |\n|---|---|---|---|---|\n| Code | Variant | `string` | `\"inline\"` |  |\n| Code | Size | `string?` | `` |  |\n| Code | ChildContent | `RenderFragment?` | `` |  |\n| Code | Class | `string?` | `` |  |\n| Code | AdditionalAttributes | `Dictionary<string, object>?` | `` |  |\n\n## Slots\n- `ChildContent` (Code) — RenderFragment slot\n\n## Events\n- (none)\n\n## Sub-components\n- (none)\n\n## Cascading values it expects\n- (none)\n\n## Services it injects\n- (none)\n\n## Keyboard\n—\n\n## Example\n```razor\n<Code />\n```\n\n## CSS variables\n`--color-muted`, `--radius`\n\n## Files\n- `UI/Code/Code.razor`\n"
}