Posts Learn Components Snippets Categories Tags Tools About
/
<div class="p-[60px] bg-slate-50">
  <div class="flex items-center justify-center">
    <div class="container">
      <div class="mt-8 grid grid-cols-2 gap-2 rounded-xl bg-white p-2 lg:grid-cols-4 w-full h-full">
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664174274811-948eceef7047?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwyMHx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664165131680-1b334b932295?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw1MHx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664136222820-e1b41101d879?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwyM3x8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664172518567-0024c1c366dc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwyOXx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664136262345-daa7e71f0c0b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwzMHx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664142315040-69e24a9c2356?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwyN3x8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664141232184-456f73b8be74?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw0NXx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
        <div class="group relative overflow-hidden rounded-xl">
          <div class="absolute inset-0 h-full w-full group-hover:bg-rose-400/20"></div>

          <img src="https://images.unsplash.com/photo-1664176062054-715f89b1974b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwzNXx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60" class="h-auto w-full" alt="Nasi lemak cover" />
        </div>
      </div>
    </div>
  </div>
</div>

Tailwind CSS Simple Gallery Component suitable for your collection of images

[email protected] 154 views

How to install and add to your project?

Step 1: Include Scripts and Styling CDN inside the head tag

<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css">
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>

Step 2: Copy the Tailwind CSS Simple Gallery Component component code above as you need it

Step 3: Preview the component in your browser 🚀

Step 4: For production release make sure to use the official Tailwind CSS Installation

You are done 🎉

Credits or Attribution

If you enjoy using our components, please do give us (PostSrc) credit in your project footer section or about page. Copy the HTML below for attribution.

<a href="https://postsrc.com/components" target="_blank" rel="noopener" title="PostSrc Components - Collection of Tailwind CSS components for everyone to use"><img style="width: auto; height: 46px;" src="https://postsrc.com/img/attr.png" alt="PostSrc logo"></a>

Sponsors 👑

+ Add Yours
)