Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/formsmd/formsmd/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The emailInput method creates an email input field with browser-native email validation. It ensures users provide properly formatted email addresses.

Method Signature

emailInput(
  name: string,
  params: FormFieldSharedParamsType & EmailInputParamsType
): string

Parameters

name
string
required
The unique identifier for this input field. Used to reference the email value in form submissions.

Required Parameters

question
string
required
The main question or label displayed to the user.

Input-Specific Parameters

placeholder
string
Sets the placeholder text displayed when the input is empty.
placeholder: "name@example.com"
maxlength
number
Sets the maximum number of allowed characters in the input.
maxlength: 254
pattern
string
Custom regex pattern for additional email validation beyond the browser default.
pattern: "^[a-zA-Z0-9._%+-]+@company\\.com$"
value
string
Sets the default email value.
value: "user@example.com"

Shared Parameters

All standard form field parameters are supported. See textInput for the complete list including required, description, fieldSize, disabled, and more.

Examples

const composer = new Composer({ title: "Contact Form" });

composer.emailInput("email", {
  question: "What is your email address?",
  required: true,
  placeholder: "name@example.com"
});

Validation

Email inputs use the browser’s built-in email validation which checks for:
  • Presence of @ symbol
  • Valid characters before and after @
  • Valid domain structure after @
These email formats will pass validation:
  • user@example.com
  • user.name@example.com
  • user+tag@example.co.uk
  • user_name@sub.example.com

Use Cases

Account Registration

Collect primary email for account creation and authentication.

Newsletter Signup

Subscribe users to mailing lists and newsletters.

Contact Forms

Gather email addresses for customer inquiries and support.

Recovery Email

Collect backup email addresses for account recovery.

Best Practices

Use realistic placeholder examples that show the expected format:
placeholder: "john.smith@company.com"
Explain how the email will be used:
description: "We'll send order confirmations to this address"
When restricting to specific domains, clearly communicate this:
description: "Must be your company email address (@company.com)",
pattern: "^[a-zA-Z0-9._%+-]+@company\\.com$"

Return Value

Returns a string containing the Forms.md markup for the email input field.

textInput

General text input for non-email text

urlInput

URL input with validation

phoneInput

Phone number input with international support