组件 结帐表格 极简灰度结账表单

极简灰度结账表单

一个复杂的响应式灰度极简风格结账表单,适用于商业/企业网站,使用 Tailwind CSS 支持暗模式。

预览

HTML 代码

<div class="min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
  <div class="max-w-md w-full space-y-8 bg-white dark:bg-gray-800 p-10 rounded-xl shadow-lg">
    <div>
      <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">
        Checkout
      </h2>
    </div>
    <form class="mt-8 space-y-6" action="#" method="POST">
      <div class="rounded-md shadow-sm -space-y-px">
        <div>
          <label for="first-name" class="sr-only">First Name</label>
          <input id="first-name" name="first-name" type="text" autocomplete="given-name" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white rounded-t-md focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="First Name">
        </div>
        <div>
          <label for="last-name" class="sr-only">Last Name</label>
          <input id="last-name" name="last-name" type="text" autocomplete="family-name" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="Last Name">
        </div>
        <div>
          <label for="email-address" class="sr-only">Email address</label>
          <input id="email-address" name="email" type="email" autocomplete="email" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="Email address">
        </div>
        <div>
          <label for="address" class="sr-only">Address</label>
          <input id="address" name="address" type="text" autocomplete="street-address" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="Address">
        </div>
        <div>
          <label for="city" class="sr-only">City</label>
          <input id="city" name="city" type="text" autocomplete="address-level2" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="City">
        </div>
        <div>
          <label for="state" class="sr-only">State / Province</label>
          <input id="state" name="state" type="text" autocomplete="address-level1" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="State / Province">
        </div>
        <div>
          <label for="zip" class="sr-only">Zip / Postal Code</label>
          <input id="zip" name="zip" type="text" autocomplete="postal-code" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white rounded-b-md focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="Zip / Postal Code">
        </div>
      </div>

      <div class="rounded-md shadow-sm -space-y-px">
        <div>
          <label for="card-number" class="sr-only">Card Number</label>
          <input id="card-number" name="card-number" type="text" autocomplete="cc-number" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white rounded-t-md focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="Card Number">
        </div>
        <div class="flex -space-x-px">
          <div class="w-1/2">
            <label for="expiration-date" class="sr-only">Expiration Date (MM/YY)</label>
            <input id="expiration-date" name="expiration-date" type="text" autocomplete="cc-exp" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="Expiration Date (MM/YY)">
          </div>
          <div class="w-1/2">
            <label for="cvc" class="sr-only">CVC</label>
            <input id="cvc" name="cvc" type="text" autocomplete="cc-csc" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="CVC">
          </div>
        </div>
        <div>
          <label for="card-name" class="sr-only">Name on Card</label>
          <input id="card-name" name="card-name" type="text" autocomplete="cc-name" required class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-700 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white rounded-b-md focus:outline-none focus:ring-black focus:border-black focus:z-10 sm:text-sm" placeholder="Name on Card">
        </div>
      </div>

      <div>
        <button type="submit" class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-gray-800 hover:bg-gray-900 dark:bg-gray-200 dark:text-gray-900 dark:hover:bg-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black dark:focus:ring-white">
          Pay Now
        </button>
      </div>
    </form>
  </div>
</div>

相关组件

结账表单组件

用于投资组合的单色配色方案的材料设计结账表单组件,支持响应式设计和黑暗主题.

打开

拟态风格结账表单

Neumorphism Checkout Form 组件,其中包含 Portfolio 网站的 Analogous 配色方案。它具有响应式设计,支持暗模式。不包含 JavaScript 代码,仅包含带有 Tailwind 类的 HTML。

打开

拟态单色复合物结帐表

一个复杂的、响应式的拟物化结帐表单,采用单色设计,适用于投资组合。包括使用 Tailwind CSS 的深色主题支持。使用渐变背景、微妙的阴影和类似于物理元素的输入字段。

打开