Component
Gradient Card
Vibrant gradient card with earnings stats, progress bar, pattern overlay, and white CTA button.
- Component
- Tailwind
- HTML
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/cards/gradient-card/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Cards/gradient-card Tailwind/Components/Cards/gradient-card <div class="relative rounded-2xl p-6 overflow-hidden">
<div class="absolute inset-0 bg-gradient-to-br from-rose-500 via-pink-500 to-purple-600"></div>
<div class="absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PGNpcmNsZSBjeD0iMzAiIGN5PSIzMCIgcj0iMiIvPjwvZz48L2c+PC9zdmc+')] opacity-50"></div>
<div class="relative">
<div class="flex items-center gap-3 mb-4">
<div class="w-12 h-12 bg-white/20 backdrop-blur rounded-xl flex items-center justify-center">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
<div>
<p class="text-white/80 text-sm">Total Earnings</p>
<p class="text-white text-2xl font-bold">$124,592</p>
</div>
</div>
<p class="text-white/80 text-sm mb-4">Your earnings have increased by 23% compared to last month. Keep up the great work!</p>
<div class="flex items-center gap-2">
<div class="flex-1 h-2 bg-white/20 rounded-full overflow-hidden">
<div class="h-full bg-white rounded-full" style="width: 78%"></div>
</div>
<span class="text-white font-semibold text-sm">78%</span>
</div>
<p class="text-white/60 text-xs mt-1">Monthly goal progress</p>
<button class="w-full mt-5 py-3 bg-white text-pink-600 font-semibold rounded-xl hover:bg-white/90 transition-colors">
View Earnings Report
</button>
</div>
</div> # Gradient Card
Card with gradient background treatment.
## Preview
Open `preview.html` for a standalone demonstration.
## Features
- Gradient surface
- Content hierarchy on top of the gradient
## Usage
```bash
npx devsnips add Tailwind/Components/Cards/gradient-card
```
Copy from `code.html`.
## Customization
- Gradient stops, text colors for contrast
## Accessibility
- Verify contrast of text against the gradient
## Dependencies
- Tailwind CSS only
## File Structure
- `code.html` · `preview.html` · `metadata.json` · `README.md` 32 lines UTF-8 · LF · Spaces: 2
Continue browsing