Comments Section Component with Neumorphism Style
Comments Section Component with Neumorphism design, responsive effects, and dark theme support. No JavaScript code is included.
HTML Code
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<style>
.neumorphic {
border-radius: 10px;
background: #e0e0e0;
box-shadow: 8px 8px 15px #bebebe, -8px -8px 15px #ffffff;
transition: all 0.3s ease;
}
.neumorphic:hover {
box-shadow: 4px 4px 8px #bebebe, -4px -4px 8px #ffffff;
}
.dark .neumorphic {
background: #333333;
box-shadow: 8px 8px 15px #222222, -8px -8px 15px #444444;
}
.dark .neumorphic:hover {
box-shadow: 4px 4px 8px #222222, -4px -4px 8px #444444;
}
.neumorphic-input {
border-radius: 5px;
background: #e0e0e0;
box-shadow: inset 5px 5px 10px #bebebe, inset -5px -5px 10px #ffffff;
padding: 10px;
width: 100%;
color: #333;
}
.dark .neumorphic-input {
background: #333333;
box-shadow: inset 5px 5px 10px #222222, inset -5px -5px 10px #444444;
color: #ccc;
}
</style>
<div class="container mx-auto p-4">
<div class="neumorphic p-6 mb-6">
<h2 class="text-2xl font-bold mb-4 text-gray-800 dark:text-white">Comments</h2>
<!-- Comment Input -->
<div class="mb-4">
<textarea class="neumorphic-input" rows="3" placeholder="Add a comment..."></textarea>
</div>
<button class="neumorphic bg-blue-500 text-white px-4 py-2 rounded">Post Comment</button>
<!-- Existing Comments -->
<div class="mt-6">
<!-- Comment 1 -->
<div class="neumorphic p-4 mb-4">
<div class="flex items-center mb-2">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Avatar" class="w-10 h-10 rounded-full mr-4 neumorphic">
<div>
<p class="font-bold text-gray-800 dark:text-white">John Doe</p>
<p class="text-sm text-gray-600 dark:text-gray-400">2 days ago</p>
</div>
</div>
<p class="text-gray-700 dark:text-gray-300">This is a great component! I love the neumorphism style.</p>
</div>
<!-- Comment 2 -->
<div class="neumorphic p-4 mb-4">
<div class="flex items-center mb-2">
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Avatar" class="w-10 h-10 rounded-full mr-4 neumorphic">
<div>
<p class="font-bold text-gray-800 dark:text-white">Jane Smith</p>
<p class="text-sm text-gray-600 dark:text-gray-400">1 day ago</p>
</div>
</div>
<p class="text-gray-700 dark:text-gray-300">Looks really good with the dark theme as well.</p>
</div>
</div>
</div>
</div>
Related Components
Comments Section Component
A responsive comments section component styled with glassmorphism design, featuring frosted glass-like translucent elements with blur effects and dark theme support using Tailwind CSS.
CommentsSection
A responsive, dark theme compatible Comments Section Component for e-commerce with minimalist/flat design, triadic color scheme, and complex interaction elements, built with Tailwind CSS. Uses picsum.photos and randomuser.me for demo images.
Comments Section Component
A minimalist comments section component designed with Tailwind CSS, featuring clean lines, responsive effects, and support for dark mode. It includes user avatars, comment text, timestamps, and a simple input area for new comments.