Problem: Toggleable filter row.

Solution#

html
<div class="flex flex-wrap gap-2">
  <button class="rounded-full border px-3 py-1 text-sm aria-pressed:bg-slate-900 aria-pressed:text-white">All</button>
</div>

Why this works#

rounded-full buttons; pressed state via aria attributes.

Variants#

  • Responsive: add screen prefixes to the core classes
  • Dark: pair each color utility with its dark: twin
  • Animated: add transition + a state variant for motion

cookbook/index|Cookbook index · utilities/index|Utilities reference · patterns/index|Layout patterns