Problem: Cover + avatar + actions.

Solution#

html
<div>
  <div class="h-40 rounded-2xl bg-gradient-to-r from-blue-500 to-fuchsia-500"></div>
  <div class="-mt-10 flex items-end gap-4 px-6">
    <img class="size-20 rounded-full ring-4 ring-white" src="a.jpg" alt="" />
    <div class="pb-1"><h1 class="font-bold">Ayesha Rahman</h1><p class="text-sm text-slate-500">@ayesha</p></div>
    <button class="mb-1 ms-auto rounded-lg bg-blue-600 px-4 py-2 text-sm text-white">Follow</button>
  </div>
</div>

Why this works#

Negative-margin avatar overlaps the cover.

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