Problem: Underline tabs.

Solution#

html
<div class="flex gap-6 border-b">
  <button class="border-b-2 border-blue-600 pb-2 text-sm font-medium text-blue-600">Active</button>
  <button class="border-b-2 border-transparent pb-2 text-sm text-slate-500 hover:text-slate-900">Other</button>
</div>

Why this works#

border-b-2 on the container border = the underline tab pattern.

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