Data display and layout
Hero
A large opening section with centered content, an optional image overlay and a seed tinted gradient.
Example
<section class="hero hero-gradient"><div class="hero-content"><h1 class="text-5xl font-extrabold tracking-tight">Ship pages that look finished</h1><p class="max-w-xl text-lg text-muted-foreground">One stylesheet, one seed color, light and dark mode out of the box.</p><div class="flex gap-2"><a class="inline-flex items-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground" href="#">Get started</a><a class="inline-flex items-center rounded-lg border border-border px-4 py-2 text-sm font-medium" href="#">Read the docs</a></div></div></section>Classes
4 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 hero. On a <section> in the example. Sets grid display, alignment, height, padding, overflow and text color.CSS |
|
| Part | Part of the hero. On a <div> in the example. Sets stacking order, flex display, alignment, gap, width and text style.CSS |
|
| Modifier | Modifier, combined with the hero class. Not used in the example above. Sets absolute position, offsets and background.CSS |
|
| Modifier | Modifier, combined with the hero class. On a <section> in the example. Sets 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">
<!-- Hero: start from the base class, then add modifiers -->
<section class="hero hero-gradient"><div class="hero-content"><h1 class="text-5xl font-extrabold tracking-tight">Ship pages that look finished</h1><p class="max-w-xl text-lg text-muted-foreground">One stylesheet, one seed color, light and dark mode out of the box.</p><div class="flex gap-2"><a class="inline-flex items-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground" href="#">Get started</a><a class="inline-flex items-center rounded-lg border border-border px-4 py-2 text-sm font-medium" href="#">Read the docs</a></div></div></section>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
- 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.