Skip to main content

BETANow in public beta.Public betaBeta

日本語Español

MDL-004 Published · Updated

Form modal

A design that takes a short form of two or three fields, such as a brochure request or an email sign-up, inside a modal without leaving the page.

FigmaThis part is included in our free, editable Figma file: 235 website UI patterns across 32 parts, 2 designs each Open in Figma Community ↗ (opens in a new tab)

Wireframe (desktop) | Form modal

Form modal UI design (desktop wireframe)

Wireframe (mobile) | Form modal

Form modal UI design (mobile wireframe)

What changes on mobile

  1. Input text at 16px or larger: Prevents the screen zooming when typing and breaking the modal.
  2. Buttons share the full width equally: Larger pressable areas, and the submit button is easier to hit.

Before you choose this pattern | Form modal

Good fit

  • A few quick fields (two or three as a guide), completed without leaving the page
  • Brochure requests, email sign-ups, details before a download
  • Readers should finish without leaving the page they are reading

Poor fit

  • Many fields, or a message to write (a contact page lets people concentrate on the input; see the <a href="/patterns/en/form-single-page/">single-page form</a>)

Why this wireframe works | Form modal

Sign up without leaving the page

A short form is taken inside the modal, so readers can sign up without leaving the page they are reading.

Focus moves to the first field on opening

The first field is focused as soon as the modal opens, so typing can begin at once.

Errors and completion conveyed inside the modal

Missing fields are shown in words right under the field, and focus moves to the first error. After sending, the same modal confirms the request was received.

The backdrop does not close it

Closing by touching the backdrop mid-entry would wipe what was typed. In this pattern the backdrop does not close the modal; only the close button and Esc do.

Common mistakes | Form modal

Input lost by a click on the backdrop

If touching the backdrop mid-entry closes the modal and wipes what was typed, readers give up. A modal with a form should not close on the backdrop.

So many fields the modal keeps scrolling

With five or six fields, readers hunt for fields inside the modal. With many fields, use a contact page.

Closing after sending without a word

If the modal closes the instant the form is sent, readers cannot tell whether it went through. Say it was received and what happens next before closing.

Errors shown by color alone

A red border alone does not reach everyone. Write the error in words and link it to the field with aria-invalid and aria-describedby.

Stacking a discard confirmation on top of the modal

When someone tries to close a form mid-entry, switch to a confirmation view inside the original modal, or close it and open a separate confirmation. Do not make a modal on top of a modal the standard approach.

FAQ | Form modal

Should closing mid-entry ask for confirmation?

If nothing has been typed yet, closing with Esc or the close button is fine. If closing mid-entry would lose the input, consider asking “Discard what you entered?” or keeping the input when the modal closes.

Form modal or contact page?

For sign-ups of two or three fields, a modal; for a message to write or many fields, a page suits better.

Can the modal close automatically after sending?

Closing before readers can read the confirmation leaves them unsure whether it was sent. Show the completion message and let them close it with the button.

Does autofill work in a form inside a modal?

Yes. Add autocomplete values to fields like name and email, and people can fill them from the browser’s suggestions. With so few fields in this pattern, autofill makes a big difference to how much typing is needed.

Related pages

Share this pattern

Send this page to your team or your design partner.

Was this pattern useful?

Written by

Yuta Okano

ENVY DESIGN Inc.

CEO / Director / Designer

14 years in the web industry. Has worked on more than 500 web projects, from corporate and recruiting sites to e-commerce. Focuses on information architecture, direction and design, from planning websites to improving them. In recent years he has focused on AIO (AI optimization) and GEO, helping sites get cited by generative AI search such as ChatGPT, Perplexity and Google AI Overviews.

Review and revision history

  1. Published AvatarYuta Okano Pattern published