Problem: Inputs with prefix/suffix.

Solution#

html
<div class="flex items-stretch overflow-hidden rounded-lg border">
  <span class="grid place-items-center bg-slate-50 px-3 text-sm text-slate-500">https://</span>
  <input class="flex-1 px-3 py-2 outline-none" />
</div>

Why this works#

Overflow-hidden rounds the group border.

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