Tailwind CSS Component Recipes

Copy-paste Tailwind CSS component recipes. Buttons, cards, forms, and more with live preview, dark mode variants, and full color breakdown.

Beginner
Intermediate
Advanced

Gradient Hero Section

A full-width hero section with gradient background, centered content, and a CTA button.

herogradient

Gradient Button

A vibrant gradient button with hover scale effect and smooth transitions.

buttongradient

Glassmorphism Card

A frosted glass card with backdrop blur, semi-transparent background, and subtle border.

cardglassmorphism

Pricing Card

A pricing plan card with highlighted price, feature list, and a CTA button.

cardpricing

Split Hero Section

A two-column hero with text on the left and an image/illustration area on the right.

herosplit

Neumorphism Card

A soft UI card with raised/inset shadows creating a physical, tactile appearance.

cardneumorphism

Product Card

An e-commerce product card with image area, price, rating, and add-to-cart button.

cardproduct

Dark Hero Section

A dark-themed hero section with a radial glow effect and bold typography.

herodark

Ghost Button

A transparent button with a border that fills with color on hover.

buttonghost

Transparent Navbar

A transparent navigation bar that overlays content with white links and a CTA button.

navbartransparent

Gradient Border Card

A card with a vibrant animated gradient border using a padding-based technique.

cardgradient

Feature Grid Section

A responsive 3-column feature grid with icon cards, perfect for showcasing product benefits.

featuresgrid

Floating Label Input

A text input with a label that floats above the field on focus using peer classes.

forminput

Pill Button

A fully rounded pill-shaped button with a solid background and shadow.

buttonpill

Feature Card

A clean feature card with an icon, title, and description for feature grid sections.

cardfeature

Dark Navbar

A solid dark navigation bar with logo, links, and a prominent CTA button.

navbardark

Image Overlay Card

A card with a background image and a gradient overlay for readable text on top.

cardimage

CTA Banner

A bold call-to-action banner with gradient background and centered messaging.

ctabanner

Icon Button

A compact square button with an icon, perfect for toolbars and action bars.

buttonicon

Testimonial Card

A customer testimonial card with avatar, quote, star rating, and attribution.

cardtestimonial

Sidebar Navigation

A vertical sidebar navigation with icon-label links and active state styling.

sidebarnavigation

Blog Post Card

A blog post card with featured image, category tag, title, excerpt, and author info.

cardblog

Gradient Form

A contact form card with a gradient header and clean input styling.

formgradient

Loading Button

A button with an animated spinner that indicates a loading state.

buttonloading

Dark Footer

A professional dark footer with multi-column links, logo, and copyright.

footerdark

Dark Form

A sleek dark-themed login form with subtle borders and a gradient submit button.

formdark

Stat Card

A dashboard stat card showing a metric value, label, and trend indicator.

cardstat

Testimonial Section

A testimonials section with a large centered quote and author attribution.

testimonialquote

Tab Navigation

Horizontal tab navigation with an active underline indicator and smooth transitions.

tabsnavigation

Outline Button

A clean outline button with a colored border and text that fills on hover.

buttonoutline

Newsletter Section

An email subscription section with an inline input and submit button.

newsletteremail

Pill Search Bar

A rounded pill-shaped search bar with an embedded search icon and clean focus state.

formsearch

Success Alert

A green success alert with a checkmark icon, message text, and dismiss button.

alertsuccess

Modal Backdrop

A centered modal dialog with a dark semi-transparent backdrop overlay.

modaldialog

Profile Card

A user profile card with avatar, name, bio, and social follow stats.

cardprofile

Bottom Navigation

A mobile-friendly bottom navigation bar with icon and label for each tab.

navigationbottom

Error Alert

A red error alert with an exclamation icon for displaying validation or server errors.

alerterror

Floating Action Button

A Material Design-inspired FAB fixed to the bottom-right corner with a shadow and hover animation.

buttonfab

Stats Section

A horizontal stats bar displaying key metrics with large numbers and labels.

statsnumbers

Toggle Switch

A custom toggle switch using a hidden checkbox and Tailwind's peer modifier.

formtoggle

Status Badge

Colored status badges with a pulsing dot indicator for active/inactive/pending states.

badgestatus

Color Swatch Grid

A grid of color swatches with hex values and copy-on-click functionality styling.

colorswatch

Gradient Footer

A modern footer with a gradient top border and clean link layout.

footergradient

Mobile Menu

A full-screen mobile menu overlay with large navigation links and a close button.

navigationmobile

Warning Alert

A yellow/amber warning alert for cautionary information and important notices.

alertwarning

Split Button

A button split into a main action and a dropdown trigger with a divider.

buttonsplit

Mega Menu Header

A navigation header with a dropdown mega menu showing categorized links in a multi-column layout.

navigationmega-menu

Gradient Badge

A small gradient badge with bold text, perfect for labeling new features or premium content.

badgegradient

Notification Card

A notification card with icon, message, time stamp, and dismiss button.

cardnotification

Select Dropdown

A styled select dropdown with custom arrow icon and consistent cross-browser appearance.

formselect

Info Toast

A floating toast notification with an info icon, positioned at the bottom of the screen.

toastnotification

Avatar Stack

Overlapping circular avatars in a horizontal stack with a count badge for extras.

avatarstack

Toggle Button

A button group where one option is active at a time, styled with active/inactive states.

buttontoggle

Radio Group Cards

A radio button group styled as selectable cards with active border highlighting.

formradio

Notification Dot

A small red notification dot badge overlaying an icon to indicate unread items.

badgenotification

Styled Accordion

A collapsible accordion with a rotating chevron indicator using the details/summary elements.

accordioncollapsible

Styled Breadcrumb

A breadcrumb navigation with chevron separators and active page highlighting.

breadcrumbnavigation

Custom Checkbox

A styled checkbox with a checkmark icon, custom colors, and smooth transitions.

formcheckbox

Loading Skeleton

A skeleton placeholder with animated shimmer effect for content loading states.

skeletonloading

Social Button

Social login buttons styled with brand colors for Google, GitHub, and Twitter.

buttonsocial

Pill Tag

A rounded pill tag with a soft background, commonly used for categories or labels.

tagpill

Gradient Progress Bar

A horizontal progress bar with a gradient fill and percentage label.

progressbar

Horizontal Stepper

A horizontal step indicator with numbered circles, connecting lines, and completed/active states.

steppersteps

Cookie Banner

A bottom-fixed cookie consent banner with accept/decline buttons.

bannercookie

Dark Tooltip

A dark tooltip that appears on hover with a small arrow pointer, using CSS-only group hover.

tooltipdark

Animated Button Hover

A button with a sliding background reveal animation on hover using pseudo-elements.

buttonanimation

Category Chip

An interactive chip with an icon and text, used for category selection with an active state.

chipcategory

Empty State

A centered empty state illustration with a message and action button for when no data is available.

empty-stateno-data

Vertical Timeline

A vertical timeline with connecting lines, dot markers, and event cards.

timelinevertical

Neon Glow Button

A cyberpunk-inspired button with a vibrant neon glow effect and pulsing shadow.

buttonneon

Outlined Tag

A tag with only a border and text color, no background fill, for a minimal look.

tagoutlined

Arrow Breadcrumb

A stepped breadcrumb with arrow-shaped segments, showing progress through a multi-step flow.

breadcrumbarrow

Countdown Badge

An urgency badge with a clock icon and countdown text, ideal for limited-time offers.

badgecountdown

Progress Badge

A badge showing completion percentage with a small inline progress bar.

badgeprogress

Gradient Divider

A horizontal divider line with a gradient from transparent to color and back, creating a fade effect.

dividergradient

Frequently Asked Questions

Do these recipes work with Tailwind CSS v4?

Yes. All recipes use standard Tailwind CSS utility classes that work with v3 and v4. We note any v4-specific features where applicable.

Can I use these in commercial projects?

Absolutely. All recipes are free to use in personal and commercial projects with no attribution required.