Tabs-Komponente
Eine responsive Tabs-Komponente mit Mikrointeraktionen für Geschäfts-/Unternehmenswebsites mit Komplementärfarben und Unterstützung für den Dunkelmodus.
HTML-Code
<div class="max-w-4xl mx-auto my-10 p-5">
<div class="border-b border-gray-300 dark:border-gray-700">
<nav class="flex space-x-4" aria-label="Tabs">
<button class="tab-button active dark:bg-gray-800 dark:text-white bg-blue-500 text-white rounded-lg px-4 py-2 transition duration-200 ease-in-out" aria-current="page">Tab 1</button>
<button class="tab-button hover:bg-blue-400 dark:hover:bg-blue-600 transition duration-200 ease-in-out rounded-lg px-4 py-2">Tab 2</button>
<button class="tab-button hover:bg-blue-400 dark:hover:bg-blue-600 transition duration-200 ease-in-out rounded-lg px-4 py-2">Tab 3</button>
</nav>
</div>
<div class="tab-content mt-4 p-5 rounded-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800">
<div id="tab-1" class="content active">
<h2 class="text-xl font-semibold">Content for Tab 1</h2>
<p>This tab contains information relevant to the first topic.</p>
<img src="https://picsum.photos/400/200" alt="Random image" class="mt-3 rounded shadow" />
</div>
<div id="tab-2" class="content hidden">
<h2 class="text-xl font-semibold">Content for Tab 2</h2>
<p>This tab contains information relevant to the second topic.</p>
<img src="https://picsum.photos/400/200" alt="Random image" class="mt-3 rounded shadow" />
</div>
<div id="tab-3" class="content hidden">
<h2 class="text-xl font-semibold">Content for Tab 3</h2>
<p>This tab contains information relevant to the third topic.</p>
<img src="https://picsum.photos/400/200" alt="Random image" class="mt-3 rounded shadow" />
</div>
</div>
</div>
<style>
.tab-button.active {
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.tab-button:hover {
transform: scale(1.05);
}
.content {
opacity: 0;
transform: translateY(20px);
transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.content.active {
opacity: 1;
transform: translateY(0);
}
.content.hidden {
display: none;
}
</style>
Verwandte Komponenten
Tabs-Komponente
Eine minimalistische und lebendige Tabs-Komponente für den E-Commerce mit moderater Komplexität, responsivem Design und Unterstützung für dunkle Themen, implementiert mit Tailwind CSS und HTML.
Skeuomorphe Tabs-Komponente
Eine responsive Tabs-Komponente, die mit Skeuomorphismus gestaltet ist und Tailwind CSS verwendet, um reale Designelemente nachzuahmen. Es enthält Unterstützung für dunkle Themen und Platzhalterbilder.
Tabs-Komponente
Eine minimalistische Tabs-Komponente für E-Commerce-Websites mit interaktiven Elementen, responsivem Design und Unterstützung für den Dunkelmodus.