Field Types

Declarative Auth Forms supports various field types to build comprehensive authentication forms.

Text Input

Standard text input field for general text entry.

{
  "name": "username",
  "type": "text",
  "label": "Username",
  "placeholder": "Enter your username",
  "required": true
}

Email

Email input with built-in validation for email format.

{
  "name": "email",
  "type": "email",
  "label": "Email Address",
  "placeholder": "you@example.com",
  "required": true
}

Password

Password input with masked characters and optional strength indicator.

{
  "name": "password",
  "type": "password",
  "label": "Password",
  "placeholder": "Enter your password",
  "required": true,
  "minLength": 8
}

Checkbox

Checkbox input for boolean values, commonly used for terms acceptance.

{
  "name": "terms",
  "type": "checkbox",
  "label": "I agree to the terms and conditions",
  "required": true
}

Select

Dropdown select for choosing from predefined options.

{
  "name": "country",
  "type": "select",
  "label": "Country",
  "options": [
    { "value": "us", "label": "United States" },
    { "value": "uk", "label": "United Kingdom" },
    { "value": "ca", "label": "Canada" }
  ],
  "required": true
}

Phone

Phone number input with format validation.

{
  "name": "phone",
  "type": "phone",
  "label": "Phone Number",
  "placeholder": "+1 (555) 000-0000",
  "required": false
}

Common Properties

All field types support these common properties:

  • name - Unique identifier for the field
  • type - The field type
  • label - Display label for the field
  • placeholder - Placeholder text
  • required - Whether the field is required
  • disabled - Whether the field is disabled
  • helperText - Additional help text below the field