Problem: Tabbed code header.

Solution#

html
<div class="overflow-hidden rounded-xl border">
  <div class="flex gap-4 border-b bg-slate-50 px-4 text-sm"><span class="border-b-2 border-blue-600 py-2 font-medium">app.css</span><span class="py-2 text-slate-500">config.js</span></div>
  <pre class="p-4 text-sm">code…</pre>
</div>

Why this works#

File tabs above the code.

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