{
  "id": "vertical-tabs",
  "name": "Vertical Tabs",
  "category": "navigation",
  "tags": [
    "tabs",
    "settings",
    "radio",
    "has",
    "side tabs",
    "no javascript"
  ],
  "description": "Tabs stacked down the left with their panel on the right, switched with radio buttons and :has().",
  "url": "https://copy-css.com/snippets/vertical-tabs",
  "markdown": "https://copy-css.com/snippets/vertical-tabs.md",
  "html": "<div class=\"vtabs\">\n  <div class=\"vtabs-list\" role=\"radiogroup\" aria-label=\"Settings\">\n    <label><input type=\"radio\" name=\"vtabs\" checked>Profile</label>\n    <label><input type=\"radio\" name=\"vtabs\">Security</label>\n    <label><input type=\"radio\" name=\"vtabs\">Billing</label>\n  </div>\n  <div class=\"vtabs-panels\">\n    <div>Name, photo and a short bio.</div>\n    <div>Password and two-factor login.</div>\n    <div>Plan, invoices and saved cards.</div>\n  </div>\n</div>",
  "css": ".vtabs {\n  display: grid;\n  grid-template-columns: auto 1fr;\n  width: 260px;\n  overflow: hidden;\n  border-radius: 14px;\n  background: #ffffff;\n  box-shadow: 0 0 0 1px #e2e8f0;\n  font: 14px/1.5 system-ui, sans-serif;\n}\n\n.vtabs-list {\n  display: grid;\n  align-content: start;\n  padding: 8px 0;\n  border-right: 1px solid #e2e8f0;\n  background: #f8fafc;\n}\n\n.vtabs-list label {\n  padding: 9px 16px;\n  border-left: 3px solid transparent;\n  color: #64748b;\n  font-weight: 600;\n  cursor: pointer;\n}\n\n.vtabs-list input {\n  position: absolute;\n  opacity: 0;\n  pointer-events: none;\n}\n\n.vtabs-list label:hover {\n  color: #0f172a;\n}\n\n.vtabs-list label:has(input:checked) {\n  border-left-color: #0d9488;\n  background: #ffffff;\n  color: #0f766e;\n}\n\n.vtabs-list label:has(input:focus-visible) {\n  outline: 2px solid #0d9488;\n  outline-offset: -2px;\n}\n\n.vtabs-panels > div {\n  display: none;\n  padding: 16px;\n  color: #334155;\n}\n\n.vtabs:has(label:nth-child(1) input:checked) .vtabs-panels > :nth-child(1),\n.vtabs:has(label:nth-child(2) input:checked) .vtabs-panels > :nth-child(2),\n.vtabs:has(label:nth-child(3) input:checked) .vtabs-panels > :nth-child(3) {\n  display: block;\n}",
  "features": [
    "box shadows",
    "CSS Grid",
    "the :has() selector",
    "the :checked state (no JavaScript)",
    "keyboard focus styles"
  ],
  "customProperties": []
}
