Problem: Segmented meter.

Solution#

html
<div class="flex gap-1">
  <span class="h-1.5 flex-1 rounded-full bg-emerald-500"></span>
  <span class="h-1.5 flex-1 rounded-full bg-emerald-500"></span>
  <span class="h-1.5 flex-1 rounded-full bg-slate-200"></span>
</div>

Why this works#

Segmented bars with colored/uncolored states.

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