Compose a Tailwind card — padding, radius, shadow, border, hover lift and optional dark: variants — previewed live with real content structure, ready to paste.
Generated locally in your browser — your colors, settings and code never leave this page.
The workhorse component, parameterized
Cards are 80% of content UI, and they are always the same five decisions: padding, radius, shadow, border, hover behavior. Toggle each and preview a real card — title, body, link — then copy markup whose content slots are obvious. Dark-mode variants (dark:bg-gray-800 and friends) are one checkbox.
Worked example
<div class="bg-white p-6 rounded-xl shadow-md border border-gray-200
transition-shadow hover:shadow-lg
dark:bg-gray-800 dark:border-gray-700">
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">Card title</h3>
…
</div>Why border AND shadow
- On white backgrounds, shadows alone can vanish — the hairline border keeps definition; on colored/dark surfaces you can drop it. Having both toggles is the point.
The hover lift
- transition-shadow + hover:shadow-lg deepens elevation smoothly without layout shift — cheaper than transform lifts and calmer visually. Interactive cards should also wrap or contain a real link/button for keyboard users.
Limitations
- Media cards (image on top) add an img with negative-margin or overflow-hidden pattern — one structural addition to the generated base.
How to use the Tailwind Card Generator
- Choose padding, radius, shadow, border, hover lift and dark-mode variants.
- Preview the card with realistic title/body/link content.
- Copy the HTML skeleton and swap in your content.
Frequently asked questions
What makes these defaults good?
The classic readable card: p-6 breathing room, rounded-xl softness, shadow-md for gentle elevation, a hairline border for definition on white backgrounds — each independently toggleable so you can deviate deliberately.
How does the hover lift work?
transition-shadow + hover:shadow-lg — the shadow deepens smoothly, reading as elevation. It is cheaper than transform-based lifts and does not shift layout.
What do the dark: classes assume?
The class strategy — dark:bg-gray-800 activates under class="dark" on the html element. Using prefers-color-scheme only? Configure Tailwind's darkMode accordingly or drop the variants.