Tooltip-Komponente
Tooltip-Komponente mit Skeuomorphismus-Stil, Komplementärfarbschema, Einfache Komplexität, für E-Commerce.
HTML-Code
<div class="relative inline-block">
<button class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded shadow-md dark:bg-gray-700 dark:hover:bg-gray-600 dark:text-gray-200">Hover over me</button>
<div class="hidden absolute z-10 px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-gray-700 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-600">
Tooltip content
<div class="tooltip-arrow"></div>
</div>
</div>
<style>
.tooltip:hover + div {
display: block;
opacity: 1;
}
.tooltip-arrow,
.tooltip-arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip-arrow {
bottom: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-bottom-color: #4a5568;
}
.dark .tooltip-arrow {
border-bottom-color: #4a5568;
}
.tooltip-arrow:after {
bottom: 1px;
margin-left: -5px;
border-width: 5px;
border-bottom-color: #4a5568;
}
.dark .tooltip-arrow:after {
border-bottom-color: #4a5568;
}
</style>
Verwandte Komponenten
Microinteractions Tooltip-Komponente
Eine einfache, aber ansprechende Tooltip-Komponente mit subtilen Mikrointeraktionsanimationen, responsivem Design und Unterstützung für dunkle Themen, die mit Tailwind CSS erstellt wurden. Es ist kein JavaScript erforderlich.
Skeuomorphe Tooltip-Komponente
Eine reaktionsschnelle Tooltip-Komponente, die mit Skeuomorphismus und lebendigen Farben entwickelt wurde und sich für Blogs und den Konsum von Inhalten eignet. Es enthält Unterstützung für dunkle Themen mit Tailwind CSS.
Retro-Tooltip-Komponente
Eine Tooltip-Komponente im Retro-/Vintage-Stil mit responsiven Effekten und Unterstützung für den Dunkelmodus.