吐司通知

一个具有玻璃物化风格的吐司通知组件,具有响应效果,并使用 Tailwind CSS 支持深色主题。

预览

HTML 代码

<div class="fixed bottom-0 right-0 mb-4 mr-4">
  <div class="bg-white dark:bg-gray-800 bg-opacity-20 dark:bg-opacity-20 backdrop-filter backdrop-blur-lg rounded-lg shadow-lg overflow-hidden mx-auto" style="max-width: 300px;">
    <div class="flex items-center justify-between px-4 py-2">
      <div class="flex items-center">
        <img class="h-8 w-8 rounded-full object-cover" src="https://randomuser.me/api/portraits/women/1.jpg" alt="Avatar">
        <p class="text-gray-700 dark:text-gray-200 text-sm font-semibold ml-2">User Name</p>
      </div>
      <button class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 focus:outline-none">
        <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
        </svg>
      </button>
    </div>
    <div class="px-4 py-2">
      <p class="text-gray-600 dark:text-gray-300 text-sm">This is a toast notification.</p>
    </div>
  </div>
</div>

相关组件

吐司通知组件

使用 Glassmorphism 设计的响应式 Toast 通知组件,具有单色配色方案、深色模式支持,并可在产品组合中使用。

打开

toast 通知组件

一种使用Tailwind CSS的拟物风格Toast通知组件,支持黑暗主题。

打开

提示通知组件

一个使用 Tailwind CSS 的极简且生动的 Toast 通知组件。该组件针对作品集设计,具有简单的布局,支持暗黑模式,并且在没有 JavaScript 的情况下响应。

打开