Problem: Compliance bar.
Solution#
<div class="fixed inset-x-4 bottom-4 z-50 mx-auto max-w-2xl rounded-2xl border bg-white p-4 shadow-2xl flex flex-wrap items-center gap-3 text-sm">
<p class="flex-1">We use cookies.</p>
<button class="rounded-lg border px-3 py-1.5">Decline</button>
<button class="rounded-lg bg-blue-600 px-3 py-1.5 text-white">Accept</button>
</div>Why this works#
Floating centered bar with actions.
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
Related recipes#
cookbook/index|Cookbook index · utilities/index|Utilities reference · patterns/index|Layout patterns
