{
  "element": "nve-code-textarea",
  "entrypoint": "@nvidia-elements/code/code-textarea/code-textarea.examples.json",
  "items": [
    {
      "id": "code-code-textarea",
      "name": "Default",
      "template": "<nve-code-textarea language=\"typescript\">\n  <label>Source code</label>\n  <textarea name=\"source\" rows=\"8\" spellcheck=\"false\">\nconst 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);</textarea>\n</nve-code-textarea>\n",
      "summary": "Edit source in a native textarea with live syntax highlighting.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-textarea-bracket-coloring",
      "name": "BracketColoring",
      "template": "<nve-code-textarea language=\"typescript\" bracket-pair-coloring>\n  <label>Nested TypeScript</label>\n  <textarea name=\"source\" rows=\"8\" spellcheck=\"false\">\nconst 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);</textarea>\n</nve-code-textarea>\n",
      "summary": "Make nested expressions easier to follow by giving matching brackets the same color.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-textarea-embedded-languages",
      "name": "EmbeddedLanguages",
      "template": "<nve-code-textarea language=\"markdown\">\n  <label>Markdown source</label>\n  <textarea name=\"markdown\" rows=\"10\" spellcheck=\"false\">\n# Release notes\n\nShow the current build status.\n\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~~~</textarea>\n</nve-code-textarea>\n",
      "summary": "Highlight source across languages, from Markdown and fenced JavaScript to tagged HTML and CSS templates.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-textarea-flat",
      "name": "Flat",
      "template": "<nve-code-textarea language=\"typescript\" container=\"flat\">\n  <label>Source code</label>\n  <textarea name=\"source\" rows=\"8\" spellcheck=\"false\">\nconst 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);</textarea>\n</nve-code-textarea>\n",
      "summary": "Fit highlighted source into the surrounding surface.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "code-code-textarea-form",
      "name": "Form",
      "template": "<form id=\"code-textarea-form\" nve-layout=\"column gap:md align:horizontal-stretch\">\n  <nve-code-textarea language=\"json\">\n    <label>Configuration</label>\n    <textarea name=\"configuration\" rows=\"5\" required spellcheck=\"false\">\n{\n  \"gpu\": \"B200\",\n  \"batchSize\": 16,\n  \"precision\": \"fp16\"\n}</textarea>\n  </nve-code-textarea>\n  <div nve-layout=\"row gap:xs\">\n    <nve-button type=\"submit\">Submit</nve-button>\n    <nve-button type=\"reset\">Reset</nve-button>\n  </div>\n</form>\n<script type=\"module\">\n  const form = document.querySelector(\"#code-textarea-form\");\n  form.addEventListener(\"submit\", (event) => {\n    event.preventDefault();\n    console.log(\"submit\", Object.fromEntries(new FormData(form)));\n  });\n</script>\n",
      "summary": "Submit and reset a highlighted JSON field with native required-field validation.",
      "description": "",
      "composition": false,
      "tags": []
    }
  ]
}