{
  "element": "nve-code-block",
  "entrypoint": "@nvidia-elements/code/code-block/code-block.examples.json",
  "items": [
    {
      "id": "code-code-block",
      "name": "Default",
      "template": "<nve-code-block id=\"gpu-inventory\" language=\"typescript\">\n  <nve-code-block-header>\n    <nve-icon slot=\"prefix\" name=\"document\" aria-hidden=\"true\"></nve-icon>\n    <span nve-text=\"body\">gpu-inventory.ts</span>\n    <nve-copy-button slot=\"suffix\" aria-label=\"Copy source\" container=\"inline\" behavior-copy></nve-copy-button>\n  </nve-code-block-header>\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n  <nve-code-block-footer><span nve-text=\"body\">Expected match · B200</span></nve-code-block-footer>\n</nve-code-block>\n<script type=\"module\">\n  const block = document.querySelector(\"#gpu-inventory\");\n  const source = block.querySelector(\"template\").content.textContent.trim();\n  block.code = source;\n  block.querySelector(\"nve-copy-button\").value = source;\n</script>\n",
      "summary": "Present syntax-highlighted source with a custom header and footer.",
      "description": "",
      "composition": true,
      "tags": []
    },
    {
      "id": "code-code-block-embedded-languages",
      "name": "EmbeddedLanguages",
      "template": "<nve-code-block language=\"markdown\" style=\"--white-space: pre-wrap\">\n  <template>\n# Release notes&#10;\nShow the current build status.&#10;\n~~~javascript\nconst status = \"Ready\";\nconst badge = html`&lt;span class=\"status\"&gt;&#36;{status}&lt;/span&gt;`;\nconst styles = css`.status { color: seagreen; }`;\n~~~\n  </template>\n</nve-code-block>\n",
      "summary": "Highlight source across languages, from Markdown and fenced JavaScript to tagged HTML and CSS templates.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-block-flat",
      "name": "Flat",
      "template": "<nve-code-block language=\"typescript\" container=\"flat\">\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n</nve-code-block>\n",
      "summary": "Fit highlighted source into the surrounding surface.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-block-theme",
      "name": "Theme",
      "template": "<div nve-layout=\"column gap:md\">\n  <nve-code-block nve-theme=\"light\" language=\"typescript\">\n    <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n    </template>\n  </nve-code-block>\n  <nve-code-block nve-theme=\"dark\" language=\"typescript\">\n    <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n    </template>\n  </nve-code-block>\n</div>\n",
      "summary": "Set the code block’s theme independently of the page.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-block-copy",
      "name": "Copy",
      "template": "<nve-code-block id=\"copy-inventory\" language=\"typescript\">\n  <nve-copy-button slot=\"actions\" aria-label=\"Copy source\" container=\"inline\" behavior-copy></nve-copy-button>\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n</nve-code-block>\n<script type=\"module\">\n  const block = document.querySelector(\"#copy-inventory\");\n  block.querySelector(\"nve-copy-button\").value = block.querySelector(\"template\").content.textContent.trim();\n</script>\n",
      "summary": "Let readers copy the source from an overlaid action.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-block-code",
      "name": "Code",
      "template": "<nve-code-block language=\"typescript\" id=\"code-property\"></nve-code-block>\n<script type=\"module\">\n  const block = document.querySelector(\"#code-property\");\n  block.code = `const gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;\\n\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);`;\n</script>\n",
      "summary": "Supply source programmatically through the `code` property.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-block-line-numbers",
      "name": "LineNumbers",
      "template": "<nve-code-block language=\"typescript\" line-numbers>\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n</nve-code-block>\n",
      "summary": "Display line numbers alongside the source.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-block-highlight",
      "name": "Highlight",
      "template": "<nve-code-block language=\"typescript\" line-numbers highlight=\"7\">\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n</nve-code-block>\n",
      "summary": "Draw attention to selected lines in numbered source.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-block-overflow",
      "name": "Overflow",
      "template": "<nve-code-block language=\"typescript\" style=\"height: 112px\">\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n</nve-code-block>\n",
      "summary": "Constrain the block’s height and let readers scroll through longer source.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "code-code-block-line-wrap",
      "name": "LineWrap",
      "template": "<div nve-layout=\"column gap:md\">\n  <div nve-layout=\"column gap:sm\">\n    <span nve-text=\"body\">Horizontal scrolling</span>\n    <nve-code-block language=\"typescript\" style=\"width: 320px; max-width: 100%; height: 112px\">\n      <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n      </template>\n    </nve-code-block>\n  </div>\n  <div nve-layout=\"column gap:sm\">\n    <span nve-text=\"body\">Line wrapping</span>\n    <nve-code-block language=\"typescript\" style=\"width: 320px; max-width: 100%; height: 112px; --white-space: pre-wrap; overflow-wrap: anywhere\">\n      <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n      </template>\n    </nve-code-block>\n  </div>\n</div>\n",
      "summary": "Compare horizontal scrolling and line wrapping for the same source in a constrained block.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "code-code-block-header-footer",
      "name": "HeaderFooter",
      "template": "<nve-code-block id=\"header-footer-code\" language=\"typescript\" style=\"height: 216px\">\n  <nve-code-block-header>\n    <nve-icon slot=\"prefix\" name=\"document\" aria-hidden=\"true\"></nve-icon>\n    <span nve-text=\"body\">gpu-inventory.ts</span>\n    <nve-copy-button slot=\"suffix\" aria-label=\"Copy source\" container=\"inline\" behavior-copy></nve-copy-button>\n  </nve-code-block-header>\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n  <nve-code-block-footer><span nve-text=\"body\">Expected match · B200</span></nve-code-block-footer>\n</nve-code-block>\n<script type=\"module\">\n  const block = document.querySelector(\"#header-footer-code\");\n  const source = block.querySelector(\"template\").content.textContent.trim();\n  block.code = source;\n  block.querySelector(\"nve-copy-button\").value = source;\n</script>\n",
      "summary": "Keep the filename, copy action, and footer visible while the source scrolls.",
      "description": "",
      "composition": true,
      "tags": []
    },
    {
      "id": "code-code-block-container",
      "name": "Container",
      "template": "<div nve-layout=\"column gap:md align:horizontal-stretch\">\n  <div nve-layout=\"column gap:sm align:horizontal-stretch\">\n    <span nve-text=\"body\">Default</span>\n    <nve-code-block language=\"typescript\">\n      <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n      </template>\n    </nve-code-block>\n  </div>\n  <div nve-layout=\"column gap:sm align:horizontal-stretch\">\n    <span nve-text=\"body\">Flat</span>\n    <nve-code-block language=\"typescript\" container=\"flat\">\n      <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n      </template>\n    </nve-code-block>\n  </div>\n  <div nve-layout=\"column gap:sm align:horizontal-stretch\">\n    <span nve-text=\"body\">Inline</span>\n    <nve-code-block language=\"typescript\" container=\"inline\">\n      <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n      </template>\n    </nve-code-block>\n  </div>\n</div>\n",
      "summary": "Match the surrounding layout with default, flat, or inline container framing.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "code-code-block-container-header-footer",
      "name": "ContainerHeaderFooter",
      "template": "<div nve-layout=\"column gap:md\">\n  <nve-code-block language=\"text\" container=\"inline\">\n    <nve-code-block-header>\n      <span nve-text=\"body\">Setup</span>\n      <nve-icon-button slot=\"suffix\" icon-name=\"copy\" aria-label=\"Copy setup commands\" container=\"inline\"></nve-icon-button>\n    </nve-code-block-header>\n    <template>\n# install CLI\ncurl -fsSL https://nvidia.github.io/elements/install.sh | bash\n\n# create a new project\nnve project.create\n\n# configure dependencies and MCP tools\nnve project.setup\n    </template>\n    <nve-code-block-footer><span nve-text=\"body\">Shell commands</span></nve-code-block-footer>\n  </nve-code-block>\n\n  <nve-code-block language=\"text\" container=\"flat\">\n    <nve-code-block-header>\n      <span nve-text=\"body\">Setup</span>\n      <nve-icon-button slot=\"suffix\" icon-name=\"copy\" aria-label=\"Copy setup commands\" container=\"inline\"></nve-icon-button>\n    </nve-code-block-header>\n    <template>\n# install CLI\ncurl -fsSL https://nvidia.github.io/elements/install.sh | bash\n\n# create a new project\nnve project.create\n\n# configure dependencies and MCP tools\nnve project.setup\n    </template>\n    <nve-code-block-footer><span nve-text=\"body\">Shell commands</span></nve-code-block-footer>\n  </nve-code-block>\n\n  <nve-code-block language=\"text\">\n    <nve-code-block-header>\n      <span nve-text=\"body\">Setup</span>\n      <nve-icon-button slot=\"suffix\" icon-name=\"copy\" aria-label=\"Copy setup commands\" container=\"inline\"></nve-icon-button>\n    </nve-code-block-header>\n    <template>\n# install CLI\ncurl -fsSL https://nvidia.github.io/elements/install.sh | bash\n\n# create a new project\nnve project.create\n\n# configure dependencies and MCP tools\nnve project.setup\n    </template>\n    <nve-code-block-footer><span nve-text=\"body\">Shell commands</span></nve-code-block-footer>\n  </nve-code-block>\n</div>\n",
      "summary": "Codeblock with container styling for different visual contexts.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "code-code-block-bracket-coloring",
      "name": "BracketColoring",
      "template": "<nve-code-block language=\"typescript\" bracket-pair-coloring>\n  <template>\nconst gpus = [\n  { name: 'B200', specs: { architecture: 'Blackwell' } },\n  { name: 'H100 SXM5', specs: { architecture: 'Hopper' } }\n] as const;&#10;\nexport const blackwellGpus = gpus.filter(gpu =>\n  gpu.specs.architecture.startsWith('Blackwell')\n);\n  </template>\n</nve-code-block>\n",
      "summary": "Make nested expressions easier to follow by giving matching brackets the same color.",
      "description": "",
      "composition": false,
      "tags": []
    }
  ]
}