tailwind css comment box example

In this section we will create tailwind comment box ui, tailwind comment form, comment box with tailwind form plugin, tailwind v3 comment box example with Tailwind CSS.


Example 1

Simple tailwind comment box.

<div class="max-w-lg shadow-md">
  <form action="" class="w-full p-4">
    <div class="mb-2">
      <label for="comment" class="text-lg text-gray-600">Add a comment</label>
      <textarea class="w-full h-20 p-2 border rounded focus:outline-none focus:ring-gray-300 focus:ring-1"
        name="comment" placeholder=""></textarea>
    </div>
    <button class="px-3 py-2 text-sm text-blue-100 bg-blue-600 rounded">Comment</button>
  </form>
</div>


Comment box using tailwind v3 shadow color.

<div class="max-w-lg rounded-lg shadow-md shadow-blue-600/50">
  <form action="" class="w-full p-4">
    <div class="mb-2">
      <label for="comment" class="text-lg text-gray-600">Add a comment</label>
      <textarea
        class="w-full h-20 p-2 border rounded focus:outline-none focus:ring-gray-300 focus:ring-1"
        name="comment"
        placeholder=""></textarea>
    </div>
    <div>
      <button class="px-3 py-2 text-sm text-blue-100 bg-blue-600 rounded">
        Comment
      </button>
      <button
        class="px-3 py-2 text-sm text-blue-600 border border-blue-500 rounded">
        Cancel
      </button>
    </div>
  </form>
</div>
tailwind v3 comment box

tailwind v3 comment box


Example 2

Comment box with tailwind css form plugin.

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Tailwind comment box with tailwindcss form plugin </title>
    <script src="https://cdn.tailwindcss.com/?plugins=forms"></script>
  </head>

  <body>
    <div class="max-w-lg shadow-md">
      <form action="" class="w-full p-4">
        <label class="block mb-2">
          <span class="text-gray-600">Add a comment</span>
          <textarea class="block w-full mt-1 rounded" rows="3"></textarea>
        </label>
        <button class="px-3 py-2 text-sm text-blue-100 bg-blue-600 rounded">Comment</button>
      </form>
    </div>
  </body>

</html>
tailwind form comment

tailwind form comment


Read Also

Tailwind CSS 3 FAQ Accordion UI Example

Tailwind CSS 3 Alert Message Example

Tailwind CSS 3 Avatars Example

Tailwind CSS 3 Badges Example

Tailwind CSS 3 Breadcrumb Example

Tailwind CSS v3 Button Examples

Tailwind CSS Gradient Button Example

Tailwind CSS 3D Button Example

Tailwind CSS Loading Button Example

Tailwind CSS v3 Cards Examples

Tailwind CSS Checkbox Form Examples

Tailwind CSS Dropdowns (Menu) on Hover Example

Tailwind CSS Multiselect Dropdown Example

How to use dark mode toggle switch in Tailwind CSS 3

How to use @apply directive in Tailwind CSS

Tailwind CSS sticky header & fixed navbar example

Tailwind CSS Navbar UI Example

Tailwind CSS 3 Login Page UI Example

Tailwind CSS Login Modal Example

Tailwind CSS Search Examples

Tailwind CSS 3 Overlay Image Example

Tailwind CSS Thank You Page Example

Tailwind CSS Timeline UI Example

Tailwind CSS Responsive Footer Section Example

Tailwind CSS Background Image Header Example