组件 Toast 通知 Toast 通知组件

Toast 通知组件

使用 Tailwind CSS 的粗野派风格的 toast 通知组件,专为展示工作或产品的作品集而设计。该设计结合了类似的配色方案,并支持具有复杂界面的深色模式。

预览

HTML 代码

<div class="fixed top-4 right-4 z-50 space-y-4">
    <div class="bg-gray-800 text-white p-4 rounded-lg shadow-lg dark:bg-gray-900 border border-red-500">
        <div class="flex items-center">
            <img class="w-10 h-10 rounded-full mr-3" src="https://randomuser.me/api/portraits/men/10.jpg" alt="Avatar">
            <div class="flex-1">
                <h2 class="font-bold text-lg">Notification Title</h2>
                <p class="text-sm">This is a sample toast notification message that showcases important updates or alerts.</p>
            </div>
            <button class="ml-2 p-2 text-sm text-red-500 hover:bg-red-400 rounded-full transition duration-200 ease-in-out">Close</button>
        </div>
    </div>
    <div class="bg-gray-800 text-white p-4 rounded-lg shadow-lg dark:bg-gray-900 border border-yellow-500">
        <div class="flex items-center">
            <img class="w-10 h-10 rounded-full mr-3" src="https://randomuser.me/api/portraits/women/10.jpg" alt="Avatar">
            <div class="flex-1">
                <h2 class="font-bold text-lg">Another Notification</h2>
                <p class="text-sm">This is another toast notification that provides insights or next steps for users.</p>
            </div>
            <button class="ml-2 p-2 text-sm text-yellow-500 hover:bg-yellow-400 rounded-full transition duration-200 ease-in-out">Close</button>
        </div>
    </div>
    <div class="bg-gray-800 text-white p-4 rounded-lg shadow-lg dark:bg-gray-900 border border-blue-500">
        <div class="flex items-center">
            <img class="w-10 h-10 rounded-full mr-3" src="https://randomuser.me/api/portraits/men/20.jpg" alt="Avatar">
            <div class="flex-1">
                <h2 class="font-bold text-lg">Success Notification</h2>
                <p class="text-sm">Your latest action was successful. Keep up the great work!</p>
            </div>
            <button class="ml-2 p-2 text-sm text-blue-500 hover:bg-blue-400 rounded-full transition duration-200 ease-in-out">Close</button>
        </div>
    </div>
</div>

相关组件

Toast 通知

一个响应式、深色主题兼容的电子商务 Toast 通知组件,采用极简/扁平化设计,采用互补色方案。

打开

吐司通知组件

一个采用玻璃形态设计的 Toast 通知组件,具有响应式效果和黑暗主题支持。它使用 Tailwind CSS 进行样式设计,并结合 picsum.photos 的占位图像和 randomuser.me 的头像。

打开

拟物化 Pastel Toast 通知

一个复杂的、拟物化的、以柔和为主题的 toast 通知组件,适用于娱乐/媒体平台,具有多种通知类型,支持深色模式和响应式设计。

打开