# Grouped Sidebar Menu

> An app sidebar with labelled sections, count badges and a clear active item, using real lists.

- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: sidebar, sections, badges, counts, app, dashboard
- Live preview: https://copy-css.com/snippets/grouped-sidebar-menu
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<nav class="group-nav" aria-label="App">
  <p class="group-nav-label" id="group-nav-mail">Mail</p>
  <ul aria-labelledby="group-nav-mail">
    <li><a href="#" aria-current="page">Inbox <span>12</span></a></li>
    <li><a href="#">Drafts <span>3</span></a></li>
  </ul>
  <p class="group-nav-label" id="group-nav-labels">Labels</p>
  <ul aria-labelledby="group-nav-labels">
    <li><a href="#">Clients</a></li>
  </ul>
</nav>
```

## CSS

```css
.group-nav {
  width: 200px;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 3px #0f172a14;
  font: 500 14px/1.3 system-ui, sans-serif;
}

.group-nav-label {
  margin: 10px 10px 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group-nav-label:first-child {
  margin-top: 2px;
}

.group-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
}

.group-nav a:hover {
  background: #f1f5f9;
}

.group-nav a[aria-current="page"] {
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
}

.group-nav a span {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  text-align: center;
}

.group-nav a[aria-current="page"] span {
  background: #ea580c;
  color: #ffffff;
}

.group-nav a:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: -2px;
}
```

## Notes

- This CSS Grouped Sidebar Menu is 67 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses box shadows, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
