# Vertical Side Nav

> A dashboard side menu with an accent bar on the active item.

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

## HTML

```html
<nav class="side-nav" aria-label="Main">
  <a href="#" aria-current="page">Dashboard</a>
  <a href="#">Projects</a>
  <a href="#">Team</a>
  <a href="#">Settings</a>
</nav>
```

## CSS

```css
.side-nav {
  display: grid;
  gap: 2px;
  width: 180px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font: 500 14px/1 system-ui, sans-serif;
}

.side-nav a {
  position: relative;
  padding: 10px 14px;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-nav a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.side-nav a[aria-current="page"] {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}

.side-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #4f46e5;
}
```

## Notes

- This CSS Vertical Side Nav is 41 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
