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.
Quickstart
This guide will walk you through creating a complete multi-step onboarding form with conditional logic in just a few minutes.What we’ll build
We’ll create a user onboarding form that:- Collects the user’s position
- Shows a follow-up field if they select “Other”
- Asks how they heard about us
- Conditionally asks for a referrer email if they were recommended
Step 1: Set up your project
First, install Forms.md and set up your HTML:Step 2: Build the form with Composer
TheComposer class provides methods to build your form programmatically:
Step 3: Initialize and render the form
Use theFormsmd class to initialize the form with your template:
Complete example
Here’s the full code in one place:Understanding the code
Composer class
TheComposer class is used to build forms programmatically:
src/composer.js:164-191
textInput()- Single or multi-line textemailInput()- Email with validationchoiceInput()- Radio buttons or checkboxesnumberInput()- Numeric input with min/maxselectBox()- Dropdown selectratingInput()- Star or heart ratingsopinionScale()- 0-10 scale inputsdateInput(),timeInput(),datetimeInput()- Date/time pickersfileInput()- File uploads- And more!
Conditional logic
UsedisplayCondition to show/hide fields based on other values:
Slides and navigation
Create multi-step forms by adding slides:Formsmd class
TheFormsmd class initializes and renders the form:
src/main.js:125-127
Handling form submissions
By default, Forms.md will POST the form data to the URL specified inpostUrl. The data is sent as JSON:
Fields that aren’t shown due to conditional logic won’t be included in the submission.
Custom submission headers
Pass custom headers via thepostHeaders option:
Include additional data
Add extra fields to every submission withpostData:
Next steps
Now that you’ve built your first form, explore more advanced features:Form inputs
Explore all available field types and their options
Theming
Customize colors, fonts, and layouts
Conditional logic
Add display conditions and slide jumps
Localization
Support multiple languages