Navigation and overlays
Dock
A mobile bottom navigation bar (also .bottom-nav) with icon items, labels, an active marker, a fixed position with safe area padding and a floating style.
Example
<nav class="dock dock-floating mx-auto" aria-label="Primary"><a href="#" class="dock-item dock-active" aria-current="page"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z"/></svg><span class="dock-label">Home</span></a><a href="#" class="dock-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg><span class="dock-label">Search</span></a><a href="#" class="dock-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 14c1.5-1.5 3-3.2 3-5.5A5.5 5.5 0 0 0 12 5a5.5 5.5 0 0 0-10 3.5c0 2.3 1.5 4 3 5.5l7 7z"/></svg><span class="dock-label">Saved</span></a><a href="#" class="dock-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg><span class="dock-label">Profile</span></a></nav>Classes
7 classes. Click a name to copy it. Utilities on the same element always win over component defaults, so any of them can be adjusted with plain utility classes.
| Class | Type | What it does |
|---|---|---|
| Base | Base class of the dock. On a <nav> in the example. Sets flex display, alignment, gap, height, padding and background, and --tone and --tone-fg.CSS |
|
| Modifier | Modifier, combined with the dock class. Not used in the example above. Sets flex display, alignment, gap, height, padding and background, and --tone and --tone-fg.CSS |
|
| Modifier | Modifier, combined with the dock class. On an <a> in the example. Sets flex display, alignment, gap, width, padding and corner radius.CSS |
|
| Modifier | Modifier, combined with the dock class. On an <a> in the example. Sets text color, generated content, absolute position, offsets, width and height.CSS |
|
| Part | Part of the dock. On a <span> in the example. Sets width, overflow and text style.CSS |
|
| Modifier | Modifier, combined with the dock class. Not used in the example above. Sets fixed position, offsets, stacking order and margin.CSS |
|
| Modifier | Modifier, combined with the dock class. On a <nav> in the example. Sets width, padding, border, corner radius, shadow and background.CSS |
Usage
Components ship inside the same stylesheet as the utilities. There is nothing else to install and no script to load: link Monsoon and write the markup.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/monsooncss">
<!-- Dock: start from the base class, then add modifiers -->
<nav class="dock dock-floating mx-auto" aria-label="Primary"><a href="#" class="dock-item dock-active" aria-current="page"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z"/></svg><span class="dock-label">Home</span></a><a href="#" class="dock-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg><span class="dock-label">Search</span></a><a href="#" class="dock-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 14c1.5-1.5 3-3.2 3-5.5A5.5 5.5 0 0 0 12 5a5.5 5.5 0 0 0-10 3.5c0 2.3 1.5 4 3 5.5l7 7z"/></svg><span class="dock-label">Saved</span></a><a href="#" class="dock-item"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg><span class="dock-label">Profile</span></a></nav>Theme it with --seed on any ancestor, for example style="--seed: #0d9488", and force a scheme with class="dark" or class="light" on a wrapper.
Accessibility
- Wrap navigation in
navwith anaria-labelwhen there is more than one on the page, and mark the current link witharia-current="page". - Every interactive part shows a visible focus ring with
:focus-visible, and tone colors pair with-foregroundtokens that keep text at 4.5:1 or better in light and dark mode.