All guides

Tailwind CSS

Build a compact form from Tailwind utilities while preserving native validation.

Copy your endpoint

Open your form in Wiztrom and copy its endpoint from Setup. Replace the example URL with that address. If you created your form from a template, use the field names and required fields from its Setup HTML.

Add markup in a scanned template

Place this in an HTML template included in your Tailwind build. The classes stack the fields and keep the button easy to tap. In React JSX, write className in place of class.

HTML
<form class="grid max-w-md gap-4" action="https://forms.wiztrom.com/f/YOUR_FORM_ID" method="post">
  <label>Name <input class="block w-full rounded border p-2" name="name" required /></label>
  <label>Email <input class="block w-full rounded border p-2" name="email" type="email" required /></label>
  <label>Message <textarea class="block w-full rounded border p-2" name="message" required></textarea></label>
  <button class="rounded bg-black px-4 py-2 text-white" type="submit">Send message</button>
</form>

Rebuild the CSS

Run your existing Tailwind build and deploy the site. If fields submit but appear unstyled, confirm your source scanner sees the literal utility names in the file containing the form.

Find the test in your inbox

On the published page, leave a required field empty and try Send. Fill it in, enter a distinctive test message and submit once. Open the form’s Wiztrom inbox and match the submitted values. If you enabled a notification, open delivery history and check its result.

References