组件 提示框 拟物化提示组件

拟物化提示组件

一个响应式工具提示组件,采用拟物化和鲜艳的色彩设计,适用于博客和内容消费。它包括使用 Tailwind CSS 的深色主题支持。

预览

HTML 代码

<div class="relative inline-block">
    <button class="bg-blue-500 text-white font-bold py-2 px-4 rounded shadow-lg hover:bg-blue-600 dark:bg-blue-700 dark:hover:bg-blue-800">
        Hover me
    </button>
    <div class="absolute left-1/2 transform -translate-x-1/2 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-lg shadow-xl opacity-0 transition-opacity duration-300 tooltip">
        <div class="flex items-center p-2">
            <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="Avatar" class="w-10 h-10 rounded-full mr-2">
            <span class="text-sm font-semibold text-gray-800 dark:text-gray-300">John Doe</span>
        </div>
        <div class="p-2">
            <p class="text-xs text-gray-600 dark:text-gray-400">
                This is a tooltip message. It provides additional information about the button.
            </p>
        </div>
    </div>
</div>

<style>
    /* Tooltip visibility on hover */
    .relative:hover .tooltip {
        opacity: 1;
    }

    /* Skeuomorphic style - shadow and border */
    .tooltip {
        box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.2);
        border-radius: 0.5rem;
    }
</style>

相关组件

工具提示

一个具有3D设计、土壤色调、简单复杂度和仪表板用途的工具提示组件。响应式设计,支持深色主题。

打开

极简工具提示

一个简单而极简的工具提示组件,支持黑暗主题和响应效果,使用Tailwind CSS构建。不使用JavaScript,仅使用HTML和CSS。

打开

Neumorphic Tooltip 组件

一个复杂的 Neumorphism 风格的工具提示组件,适用于商业网站,采用鲜艳的色彩,专为暗模式支持而设计。

打开