TheDocumentation 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.
Composer class is your primary tool for creating form templates programmatically. It provides a chainable API for building multi-step forms with form fields, slides, and conditional logic.
Overview
Composer generates a Forms.md template string that you pass to theFormsmd class for rendering. All methods are chainable and append to an internal template property.
Constructor
Create a new Composer instance with optional settings:Settings type
The constructor accepts aSettingsType object with the following properties:
View all settings properties
View all settings properties
| Property | Type | Description | |
|---|---|---|---|
id | string | Identifier for the page or form | |
postUrl | string | URL to send form responses to using POST request | |
page | "form-slides" | "slides" | "single" | Determines the layout of the page | |
slideDelimiter | string | Specifies where new slides are created (default: "---") | |
formDelimiter | string | Used to separate parameters when creating form fields (default: `" | "`) |
accent | string | The primary color used on buttons, form fields, etc. | |
backgroundColor | string | The background color of the page | |
color | string | The text color on the page | |
title | string | The title of the page | |
localization | string | Sets the language for automatic translation (default: "en") | |
pageProgress | "hide" | "show" | "decorative" | Controls visibility and function of the page progress |
types/composer.d.tsCreating form fields
Composer provides methods for all Forms.md form field types. Each method accepts a field name and a params object.Text input
src/composer.js
Email input
src/composer.js
Choice input
src/composer.js
Number input
src/composer.js
All form field methods share common parameters like
question, required, description, fieldSize, labelStyle, disabled, autofocus, id, classNames, and displayCondition.Available form field methods
textInput
Create a text input field with optional multiline support
emailInput
Create an email input with built-in validation
urlInput
Create a URL input field
telInput
Create a telephone input with country code selector
passwordInput
Create a password input field
numberInput
Create a number input with min/max/step controls
selectBox
Create a dropdown select field
choiceInput
Create radio buttons or checkboxes
pictureChoice
Create image-based choice options
ratingInput
Create a star/heart rating input
opinionScale
Create an opinion scale (e.g., 0-10)
datetimeInput
Create a datetime picker
dateInput
Create a date picker
timeInput
Create a time picker
fileInput
Create a file upload field
Method chaining
All Composer methods return the generated template string and also append it tocomposer.template, enabling clean method chaining:
Shared field parameters
All form fields accept these shared parameters from theFormFieldSharedParamsType:
Creating slides
Use theslide() method to create new slides in multi-step forms:
src/composer.js
Special slide types
Start slide
Create a welcome/intro slide with a custom start button:src/composer.js
End slide
Create a completion slide with optional redirect:src/composer.js
Additional methods
Data blocks
Embed data directly in the template:src/composer.js
Free-form content
Add custom Markdown content:src/composer.js
Block elements
Create semantic HTML elements:Accessing the template
The generated template is available in thetemplate property:
Next steps
Formsmd class
Learn how to render your templates
Slides
Create multi-step forms with slides
Conditional logic
Add dynamic behavior to your forms