组件 聊天窗口 聊天窗口组件

聊天窗口组件

一个简单的聊天窗口组件,采用材料设计风格,具有深色主题和适合社交媒体界面的响应式布局。

预览

HTML 代码

<div class="h-screen bg-gray-100 dark:bg-gray-800 flex flex-col justify-end">
    <div class="max-w-md w-full bg-white dark:bg-gray-900 rounded-lg shadow-lg p-4">
        <div class="flex flex-col space-y-4 overflow-y-scroll h-80">
            <div class="flex items-start space-x-2">
                <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User Avatar" class="w-8 h-8 rounded-full">
                <div class="bg-blue-500 text-white p-2 rounded-lg rounded-bl-none">
                    Hello, how are you?
                </div>
            </div>
            <div class="flex items-start space-x-2">
                <img src="https://randomuser.me/api/portraits/women/32.jpg" alt="User Avatar" class="w-8 h-8 rounded-full">
                <div class="bg-gray-300 text-gray-800 p-2 rounded-lg rounded-br-none">
                    I'm good, thanks! How about you?
                </div>
            </div>
            <div class="flex items-start space-x-2">
                <img src="https://randomuser.me/api/portraits/men/33.jpg" alt="User Avatar" class="w-8 h-8 rounded-full">
                <div class="bg-blue-500 text-white p-2 rounded-lg rounded-bl-none">
                    I'm doing well! Ready for the weekend?
                </div>
            </div>
        </div>
        <div class="mt-4 flex">
            <input type="text" placeholder="Type your message..." class="flex-1 bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white rounded-lg p-2 focus:outline-none focus:ring focus:ring-blue-500">
            <button class="bg-blue-500 text-white p-2 rounded-lg ml-2 focus:outline-none">Send</button>
        </div>
    </div>
</div>

相关组件

聊天窗口组件

一个以野蛮主义风格设计的聊天窗口组件,具有高对比度、响应式效果和暗黑主题支持。

打开

具有3D设计、响应式和暗模式的聊天窗口组件

一个具有3D设计元素和深色主题支持的响应式聊天窗口组件,使用Tailwind CSS。包括占位符头像和图片。

打开

聊天窗口组件

一个具有深色模式支持并使用 Tailwind CSS 的响应式聊天窗口组件。它具有包含用户信息的标题、显示收发消息的消息区域,以及用于输入新消息的页脚。图像是来自 picsum.photos 和 randomuser.me 的占位符。

打开