Karussell-Slider-Komponente
Eine einfache Karussell-Slider-Komponente, die für den E-Commerce im Dunkelmodus mit Tailwind CSS entwickelt wurde.
HTML-Code
<div class="relative w-full max-w-lg mx-auto">
<div class="overflow-hidden rounded-lg shadow-lg">
<div class="carousel-inner dark:bg-gray-800 bg-gray-100">
<div class="carousel-item active">
<img src="https://picsum.photos/800/400?1" alt="Product 1" class="w-full h-auto">
<div class="p-4">
<h2 class="text-lg font-semibold text-white dark:text-gray-200">Product 1</h2>
<p class="text-sm text-gray-700 dark:text-gray-300">Description of product 1</p>
<button class="mt-2 px-4 py-2 bg-teal-500 dark:bg-teal-700 text-white rounded hover:bg-teal-600 dark:hover:bg-teal-800">Buy Now</button>
</div>
</div>
<div class="carousel-item">
<img src="https://picsum.photos/800/400?2" alt="Product 2" class="w-full h-auto">
<div class="p-4">
<h2 class="text-lg font-semibold text-white dark:text-gray-200">Product 2</h2>
<p class="text-sm text-gray-700 dark:text-gray-300">Description of product 2</p>
<button class="mt-2 px-4 py-2 bg-teal-500 dark:bg-teal-700 text-white rounded hover:bg-teal-600 dark:hover:bg-teal-800">Buy Now</button>
</div>
</div>
<div class="carousel-item">
<img src="https://picsum.photos/800/400?3" alt="Product 3" class="w-full h-auto">
<div class="p-4">
<h2 class="text-lg font-semibold text-white dark:text-gray-200">Product 3</h2>
<p class="text-sm text-gray-700 dark:text-gray-300">Description of product 3</p>
<button class="mt-2 px-4 py-2 bg-teal-500 dark:bg-teal-700 text-white rounded hover:bg-teal-600 dark:hover:bg-teal-800">Buy Now</button>
</div>
</div>
</div>
<!-- Carousel controls (optional) -->
<button class="absolute top-1/2 left-0 transform -translate-y-1/2 bg-gray-600 dark:bg-gray-700 rounded-full p-2 text-white">
❮
</button>
<button class="absolute top-1/2 right-0 transform -translate-y-1/2 bg-gray-600 dark:bg-gray-700 rounded-full p-2 text-white">
❯
</button>
</div>
</div>
<style>
.carousel-inner {
display: flex;
transition: transform 0.5s ease;
}
.carousel-item {
min-width: 100%;
box-sizing: border-box;
}
</style>
Verwandte Komponenten
Brutalismus Karussell Schieberegler Komponente
Brutalism Carousel Slider mit Tailwind CSS, Reaktionsfähigkeit und Dunkelmodus. Enthält Navigationsschaltflächen und verwendet Platzhalterbilder.
Karussell-Slider-Komponente
Eine komplexe, reaktionsschnelle Karussell-Slider-Komponente für Nachrichten-/Journalismus-Websites mit einer Benutzeroberfläche im Dunkelmodus mit einem Graustufen-Farbschema. Es zeigt Nachrichtenartikel mit Bildern, Titeln, Beschreibungen und Kategorien an und wurde entwickelt, um die Belastung der Augen zu reduzieren.
Karussell-Slider-Komponente im Dunkelmodus
Dark Mode Carousel Slider Component mit responsiven Effekten und Unterstützung für dunkle Themen unter Verwendung von Tailwind CSS.