Components Cards Cards Component

Cards Component

Responsive Dark Mode Card Component for Portfolio with Pastel color scheme.

Preview

HTML Code

<!-- ./ src/components/Card.astro -->

<div class="max-w-sm mx-auto rounded-md overflow-hidden shadow-lg bg-white dark:bg-gray-800 m-4">
  <img class="w-full" src="https://picsum.photos/400/250" alt="Placeholder image">
  <div class="px-6 py-4">
    <div class="font-bold text-xl mb-2 text-gray-800 dark:text-white">Card Title</div>
    <p class="text-gray-700 dark:text-gray-300 text-base">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    </p>
  </div>
  <div class="px-6 pt-4 pb-2">
    <span class="inline-block bg-pastel-pink rounded-full px-3 py-1 text-sm font-semibold text-gray-700 dark:text-gray-800 mr-2 mb-2">#tag1</span>
    <span class="inline-block bg-pastel-green rounded-full px-3 py-1 text-sm font-semibold text-gray-700 dark:text-gray-800 mr-2 mb-2">#tag2</span>
    <span class="inline-block bg-pastel-blue rounded-full px-3 py-1 text-sm font-semibold text-gray-700 dark:text-gray-800 mb-2">#tag3</span>
  </div>
    <div class="flex items-center px-6 py-4">
        <img class="w-10 h-10 rounded-full mr-4" src="https://randomuser.me/api/portraits/men/1.jpg" alt="Avatar of user">
        <div class="text-sm">
            <p class="text-gray-900 dark:text-white leading-none">John Doe</p>
            <p class="text-gray-600 dark:text-gray-400">Aug 18, 2023</p>
        </div>
    </div>
</div>

<style>
  .bg-pastel-pink {
    background-color: #f9cdda;
  }
  .bg-pastel-green {
    background-color: #b2f2bb;
  }
  .bg-pastel-blue {
    background-color: #a7ccff;
  }
</style>

Related Components

Skeuomorphic Cards Component

Inspired by Skeuomorphism, the following card component is fully responsive with dark theme support. For dark mode, CSS support is sufficient. No JavaScript is needed.

Open

3D Cards Component

A responsive card component with a 3D design style, vibrant colors, and multiple interactive elements, suitable for a dashboard. It supports dark mode using Tailwind's dark prefix.

Open

Glassmorphism Cards Component

Glassmorphism Cards Component with Vibrant Colors. Responsive design with dark theme support. Uses picsum.photos for images and randomuser.me for avatars.

Open