组件 警报消息 警报消息组件

警报消息组件

一个带有3D设计、响应特性和黑暗主题支持的警报消息组件,使用Tailwind CSS。该组件包括不同类型的警报(成功、错误、警告、信息),带有图标和消息。

预览

HTML 代码

<div class="flex flex-col space-y-4 p-6">  <!-- Success Alert -->  <div class="relative flex items-center justify-between bg-green-500 text-white py-3 px-4 rounded-lg shadow-lg transform transition duration-300 hover:scale-105 dark:bg-green-700">    <div class="flex items-center space-x-2">      <svg class="w-6 h-6" 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="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>      </svg>      <span class="font-semibold">Success:</span>      <span>Your action was successful.</span>    </div>    <button class="text-white hover:text-gray-200 focus:outline-none">      <svg class="w-5 h-5" 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>  <!-- Error Alert -->  <div class="relative flex items-center justify-between bg-red-500 text-white py-3 px-4 rounded-lg shadow-lg transform transition duration-300 hover:scale-105 dark:bg-red-700">    <div class="flex items-center space-x-2">      <svg class="w-6 h-6" 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="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>      </svg>      <span class="font-semibold">Error:</span>      <span>Something went wrong.</span>    </div>    <button class="text-white hover:text-gray-200 focus:outline-none">      <svg class="w-5 h-5" 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>  <!-- Warning Alert -->  <div class="relative flex items-center justify-between bg-yellow-500 text-white py-3 px-4 rounded-lg shadow-lg transform transition duration-300 hover:scale-105 dark:bg-yellow-700">    <div class="flex items-center space-x-2">      <svg class="w-6 h-6" 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="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>      </svg>      <span class="font-semibold">Warning:</span>      <span>Proceed with caution.</span>    </div>    <button class="text-white hover:text-gray-200 focus:outline-none">      <svg class="w-5 h-5" 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>  <!-- Info Alert -->  <div class="relative flex items-center justify-between bg-blue-500 text-white py-3 px-4 rounded-lg shadow-lg transform transition duration-300 hover:scale-105 dark:bg-blue-700">    <div class="flex items-center space-x-2">      <svg class="w-6 h-6" 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="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>      </svg>      <span class="font-semibold">Info:</span>      <span>Here is some information.</span>    </div>    <button class="text-white hover:text-gray-200 focus:outline-none">      <svg class="w-5 h-5" 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>

相关组件

警报消息组件

一个简单的单色警报消息组件,适用于博客,具有以微交互为中心的动画、深色模式支持和响应性。

打开

有机自然灵感警报

一个简单的响应式警报消息组件,具有有机/自然灵感的设计、互补的配色方案,适用于咨询/服务网站。包括深色模式支持。

打开

警报消息组件

具有 Material Design 样式、柔和配色方案和复杂复杂程度的警报消息组件,用于投资组合。支持深色主题的响应式设计。不需要 JavaScript 代码,只需要带有 Tailwind 类的 HTML。深色模式使用 Tailwind 的 dark: 前缀进行样式设置。图像使用 picsum.photos 表示图像,randomuser.me 表示头像。

打开