Catalogo design-system forms/textareas

← catalogo / forms/textareas

Forms · Textareas · With underline and actions

TW-FO-TE-03 Tailwind Plus

tailwind/application-ui/forms/textareas/03-with-underline-and-actions

Pacchetti da installare

@tailwindplus/elements

Da toccare per il marchio

  • colore indigo: sostituisci col colore del marchio
  • foto segnaposto da unsplash: sostituisci le immagini

Sorgente (html)

<!-- Include this script tag or install `@tailwindplus/elements` via npm: -->
<!-- <script src="https://cdn.jsdelivr.net/npm/@tailwindplus/elements@1" type="module"></script> -->
<div class="flex items-start space-x-4">
  <div class="shrink-0">
    <img src="https://images.unsplash.com/photo-1550525811-e5869dd03032?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" class="inline-block size-10 rounded-full bg-gray-100 outline -outline-offset-1 outline-black/5 dark:bg-gray-800 dark:outline-white/10" />
  </div>
  <div class="min-w-0 flex-1">
    <form action="#">
      <div class="border-b border-gray-200 pb-px focus-within:border-b-2 focus-within:border-indigo-600 focus-within:pb-0 dark:border-white/10 dark:focus-within:border-indigo-500">
        <label for="comment" class="sr-only">Add your comment</label>
        <textarea id="comment" name="comment" rows="3" placeholder="Add your comment..." class="block w-full resize-none text-base text-gray-900 placeholder:text-gray-400 focus:outline-none sm:text-sm/6 dark:text-white dark:placeholder:text-gray-500"></textarea>
      </div>
      <div class="flex justify-between pt-2">
        <div class="flex items-center space-x-5">
          <div class="flow-root">
            <button type="button" class="-m-2 inline-flex size-10 items-center justify-center rounded-full text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-white">
              <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-slot="icon" aria-hidden="true" class="size-6">
                <path d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" stroke-linecap="round" stroke-linejoin="round" />
              </svg>
              <span class="sr-only">Attach a file</span>
            </button>
          </div>
          <div class="flow-root">
            <el-select name="selected" value="">
              <button type="button" aria-label="Your mood" class="relative -m-2.5 flex size-10 items-center justify-center rounded-full text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-white">
                <el-selectedcontent class="flex items-center justify-center">
                  <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0">
                    <path d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.536-4.464a.75.75 0 1 0-1.061-1.061 3.5 3.5 0 0 1-4.95 0 .75.75 0 0 0-1.06 1.06 5 5 0 0 0 7.07 0ZM9 8.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S7.448 7 8 7s1 .672 1 1.5Zm3 1.5c.552 0 1-.672 1-1.5S12.552 7 12 7s-1 .672-1 1.5.448 1.5 1 1.5Z" clip-rule="evenodd" fill-rule="evenodd" />
                  </svg>
                  <span class="sr-only">Add your mood</span>
                </el-selectedcontent>
              </button>

              <el-options anchor="bottom start" popover class="-ml-3.5 w-60 rounded-lg bg-white py-3 text-base shadow-sm outline-1 outline-black/5 [--anchor-gap:-4px] data-leave:transition data-leave:transition-discrete data-leave:duration-100 data-leave:ease-in data-closed:data-leave:opacity-0 sm:ml-2.5 sm:w-64 sm:text-sm dark:bg-gray-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10">
                <el-option value="excited" class="relative block cursor-default bg-white px-3 py-2 select-none focus:bg-gray-100 focus:outline-hidden dark:bg-transparent dark:text-white dark:focus:bg-white/5">
                  <div class="flex items-center">
                    <div class="flex size-8 items-center justify-center rounded-full bg-red-500">
                      <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0 text-white">
                        <path d="M13.5 4.938a7 7 0 1 1-9.006 1.737c.202-.257.59-.218.793.039.278.352.594.672.943.954.332.269.786-.049.773-.476a5.977 5.977 0 0 1 .572-2.759 6.026 6.026 0 0 1 2.486-2.665c.247-.14.55-.016.677.238A6.967 6.967 0 0 0 13.5 4.938ZM14 12a4 4 0 0 1-4 4c-1.913 0-3.52-1.398-3.91-3.182-.093-.429.44-.643.814-.413a4.043 4.043 0 0 0 1.601.564c.303.038.531-.24.51-.544a5.975 5.975 0 0 1 1.315-4.192.447.447 0 0 1 .431-.16A4.001 4.001 0 0 1 14 12Z" clip-rule="evenodd" fill-rule="evenodd" />
                      </svg>
                    </div>
                    <span class="ml-3 block truncate font-medium in-[el-selectedcontent]:hidden">Excited</span>
                  </div>
                </el-option>
                <el-option value="loved" class="relative block cursor-default bg-white px-3 py-2 select-none focus:bg-gray-100 focus:outline-hidden dark:bg-transparent dark:text-white dark:focus:bg-white/5">
                  <div class="flex items-center">
                    <div class="flex size-8 items-center justify-center rounded-full bg-pink-400">
                      <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0 text-white">
                        <path d="m9.653 16.915-.005-.003-.019-.01a20.759 20.759 0 0 1-1.162-.682 22.045 22.045 0 0 1-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 0 1 8-2.828A4.5 4.5 0 0 1 18 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 0 1-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 0 1-.69.001l-.002-.001Z" />
                      </svg>
                    </div>
                    <span class="ml-3 block truncate font-medium in-[el-selectedcontent]:hidden">Loved</span>
                  </div>
                </el-option>
                <el-option value="happy" class="relative block cursor-default bg-white px-3 py-2 select-none focus:bg-gray-100 focus:outline-hidden dark:bg-transparent dark:text-white dark:focus:bg-white/5">
                  <div class="flex items-center">
                    <div class="flex size-8 items-center justify-center rounded-full bg-green-400">
                      <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0 text-white">
                        <path d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.536-4.464a.75.75 0 1 0-1.061-1.061 3.5 3.5 0 0 1-4.95 0 .75.75 0 0 0-1.06 1.06 5 5 0 0 0 7.07 0ZM9 8.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S7.448 7 8 7s1 .672 1 1.5Zm3 1.5c.552 0 1-.672 1-1.5S12.552 7 12 7s-1 .672-1 1.5.448 1.5 1 1.5Z" clip-rule="evenodd" fill-rule="evenodd" />
                      </svg>
                    </div>
                    <span class="ml-3 block truncate font-medium in-[el-selectedcontent]:hidden">Happy</span>
                  </div>
                </el-option>
                <el-option value="sad" class="relative block cursor-default bg-white px-3 py-2 select-none focus:bg-gray-100 focus:outline-hidden dark:bg-transparent dark:text-white dark:focus:bg-white/5">
                  <div class="flex items-center">
                    <div class="flex size-8 items-center justify-center rounded-full bg-yellow-400">
                      <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0 text-white">
                        <path d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm-3.536-3.475a.75.75 0 0 0 1.061 0 3.5 3.5 0 0 1 4.95 0 .75.75 0 1 0 1.06-1.06 5 5 0 0 0-7.07 0 .75.75 0 0 0 0 1.06ZM9 8.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S7.448 7 8 7s1 .672 1 1.5Zm3 1.5c.552 0 1-.672 1-1.5S12.552 7 12 7s-1 .672-1 1.5.448 1.5 1 1.5Z" clip-rule="evenodd" fill-rule="evenodd" />
                      </svg>
                    </div>
                    <span class="ml-3 block truncate font-medium in-[el-selectedcontent]:hidden">Sad</span>
                  </div>
                </el-option>
                <el-option value="thumbsy" class="relative block cursor-default bg-white px-3 py-2 select-none focus:bg-gray-100 focus:outline-hidden dark:bg-transparent dark:text-white dark:focus:bg-white/5">
                  <div class="flex items-center">
                    <div class="flex size-8 items-center justify-center rounded-full bg-blue-500">
                      <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0 text-white">
                        <path d="M1 8.25a1.25 1.25 0 1 1 2.5 0v7.5a1.25 1.25 0 1 1-2.5 0v-7.5ZM11 3V1.7c0-.268.14-.526.395-.607A2 2 0 0 1 14 3c0 .995-.182 1.948-.514 2.826-.204.54.166 1.174.744 1.174h2.52c1.243 0 2.261 1.01 2.146 2.247a23.864 23.864 0 0 1-1.341 5.974C17.153 16.323 16.072 17 14.9 17h-3.192a3 3 0 0 1-1.341-.317l-2.734-1.366A3 3 0 0 0 6.292 15H5V8h.963c.685 0 1.258-.483 1.612-1.068a4.011 4.011 0 0 1 2.166-1.73c.432-.143.853-.386 1.011-.814.16-.432.248-.9.248-1.388Z" />
                      </svg>
                    </div>
                    <span class="ml-3 block truncate font-medium in-[el-selectedcontent]:hidden">Thumbsy</span>
                  </div>
                </el-option>
                <el-option value="" class="relative block cursor-default bg-white px-3 py-2 select-none focus:bg-gray-100 focus:outline-hidden dark:bg-transparent dark:text-white dark:focus:bg-white/5">
                  <div class="flex items-center">
                    <div class="flex size-8 items-center justify-center rounded-full bg-transparent in-[el-selectedcontent]:hidden">
                      <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0 text-gray-400 dark:text-gray-500">
                        <path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" />
                      </svg>
                    </div>
                    <span class="hidden in-[el-selectedcontent]:inline">
                      <svg viewBox="0 0 20 20" fill="currentColor" data-slot="icon" aria-hidden="true" class="size-5 shrink-0">
                        <path d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.536-4.464a.75.75 0 1 0-1.061-1.061 3.5 3.5 0 0 1-4.95 0 .75.75 0 0 0-1.06 1.06 5 5 0 0 0 7.07 0ZM9 8.5c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S7.448 7 8 7s1 .672 1 1.5Zm3 1.5c.552 0 1-.672 1-1.5S12.552 7 12 7s-1 .672-1 1.5.448 1.5 1 1.5Z" clip-rule="evenodd" fill-rule="evenodd" />
                      </svg>
                      <span class="sr-only">Add your mood</span>
                    </span>
                    <span class="ml-3 block truncate font-medium in-[el-selectedcontent]:hidden">I feel nothing</span>
                  </div>
                </el-option>
              </el-options>
            </el-select>
          </div>
        </div>
        <div class="shrink-0">
          <button type="submit" class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-xs hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 dark:bg-indigo-500 dark:shadow-none dark:hover:bg-indigo-400 dark:focus-visible:outline-indigo-500">Post</button>
        </div>
      </div>
    </form>
  </div>
</div>