Question Types
md2form supports a rich variety of question types to meet various form requirements. This page provides detailed explanations of all question types and their usage.
Text Input
short_text - Short Text Input
A single-line text input field. Used for short strings such as names and titles.
### Your Name
#type short_text
#placeholder "John Doe"
#required true
#maxLength 50Supported Properties:
placeholder: Placeholder textmaxLength: Maximum number of charactersdefault: Default valuerequired: Required inputvisible: Show/hide
long_text - Long Text Input
A multi-line text input field. Used for comments, opinions, and detailed descriptions.
### Feedback/Suggestions
#type long_text
#placeholder "Please feel free to write"
#maxLength 1000
#richText trueSupported Properties:
placeholder: Placeholder textmaxLength: Maximum number of charactersdefault: Default valuerichText: Enable rich text editingrequired: Required inputvisible: Show/hide
email - Email Address Input
A specialized input field for email addresses. Automatic format validation is performed.
### Email Address
#type email
#placeholder "example@example.com"
#required true
#allowMultiple falseSupported Properties:
placeholder: Placeholder textdefault: Default valueallowMultiple: Allow multiple email addressesrequired: Required inputvisible: Show/hide
phone - Phone Number Input
A specialized input field for phone numbers.
### Phone Number
#type phone
#placeholder "123-456-7890"
#countryCodeRequired falseSupported Properties:
placeholder: Placeholder textcountryCodeRequired: Require country codedefault: Default valuerequired: Required inputvisible: Show/hide
Numeric Input
number - Numeric Input
A specialized input field for numbers. Used for numeric data such as age, price, and quantity.
### Age
#type number
#min 0
#max 120
#step 1
#placeholder "Enter a number"
#integerOnly trueSupported Properties:
placeholder: Placeholder textmin: Minimum valuemax: Maximum valuestep: Increment valuedefault: Default valueintegerOnly: Allow only integersrequired: Required inputvisible: Show/hide
Selection
dropdown - Dropdown Selection
A dropdown menu field for selecting one choice from multiple options.
### State/Province
#type dropdown
#options "California","Texas","New York","Florida","Other"
#searchable true
#allowOther falseSupported Properties:
options: List of choices (comma-separated)allowOther: Allow “Other” choicedefault: Default selected valuesearchable: Enable search functionalityrequired: Required selectionvisible: Show/hide
radio - Radio Button Selection
A single selection field using radio buttons. Best for forms with few choices.
### Gender
#type radio
#options "Male","Female","Other","Prefer not to say"
#allowOther falseSupported Properties:
options: List of choices (comma-separated)allowOther: Allow “Other” choicedefault: Default selected valuerequired: Required selectionvisible: Show/hide
checkbox - Checkbox Selection
A multiple selection field using checkboxes.
### Areas of Interest
#type checkbox
#options "AI/Machine Learning","Web Development","Mobile Apps","Data Science","Design"
#minSelected 1
#maxSelected 3Supported Properties:
options: List of choices (comma-separated)minSelected: Minimum number of selectionsmaxSelected: Maximum number of selectionsdefault: Default selected values listrequired: Required selectionvisible: Show/hide
Date/Time
date - Date Selection
A date selection field.
### Date of Birth
#type date
#includeTime false
#minDate "1900-01-01"
#maxDate "2024-12-31"Supported Properties:
includeTime: Whether to include timeminDate: Minimum date (ISO format)maxDate: Maximum date (ISO format)default: Default daterequired: Required inputvisible: Show/hide
time - Time Selection
A time selection field.
### Preferred Time
#type time
#minTime "09:00"
#maxTime "18:00"
#stepMinutes 30Supported Properties:
minTime: Minimum time (“HH:MM” format)maxTime: Maximum time (“HH:MM” format)stepMinutes: Time increment (minutes)default: Default timerequired: Required inputvisible: Show/hide
Rating/Scale
rating - Star Rating
A rating field using star icons.
### Service Satisfaction
#type rating
#scale 5
#labels "Dissatisfied","Very Satisfied"
#icon starSupported Properties:
scale: Number of rating levels (e.g., 5-point scale)labels: Labels for lowest and highest ratingsicon: Icon type (star, heart, circle)default: Default ratingrequired: Required inputvisible: Show/hide
likert - Likert Scale
A field for rating multiple items on a single scale.
### Course Evaluation
#type likert
#statements "Clarity of content","Teaching quality","Material completeness","Exercise appropriateness"
#scaleLabels "Strongly Disagree","Disagree","Neutral","Agree","Strongly Agree"
#requiredPerStatement trueSupported Properties:
statements: List of rating itemsscaleLabels: List of scale labelsrequiredPerStatement: Rate each item as requiredrequired: Required inputvisible: Show/hide
matrix - Matrix (Grid)
A field for rating and selection using a combination of rows and columns.
### Weekly Schedule
#type matrix
#rows "Monday","Tuesday","Wednesday","Thursday","Friday"
#columns "Morning","Afternoon","Evening"
#cellType radio
#requiredPerRow trueSupported Properties:
rows: List of row labelscolumns: List of column labelscellType: Cell type (radio, checkbox, number, short_text)requiredPerRow: Each row requires inputrequired: Required inputvisible: Show/hide
scale - Scale (Slider)
A slider field for rating on a numeric scale.
### English Level Self-Assessment
#type scale
#min 1
#max 10
#step 1
#minLabel "Beginner"
#maxLabel "Native Level"Supported Properties:
min: Minimum valuemax: Maximum valuestep: Increment valueminLabel: Label for minimum valuemaxLabel: Label for maximum valuedefault: Default valuerequired: Required inputvisible: Show/hide
File/Signature
file_upload - File Upload
File upload functionality.
### Resume Upload
#type file_upload
#allowedTypes "pdf","docx","doc"
#maxFiles 1
#maxSizeMB 10Supported Properties:
allowedTypes: Allowed file formatsmaxFiles: Maximum number of filesmaxSizeMB: Maximum file size (MB)required: Required uploadvisible: Show/hide
signature - Digital Signature
A field for capturing digital signatures.
### Digital Signature
#type signature
#captureMode draw
#required trueSupported Properties:
captureMode: Signature capture method (draw, type, upload)required: Required signaturevisible: Show/hide
Media/Display
image - Image Display
A field for displaying images (display only, not input).
### Product Image
#type image
#src "https://example.com/product.jpg"
#alt "Product photo"
#width 300
#caption "Product Preview"Supported Properties:
src: Image URLalt: Alternative textwidth: Width (pixels or “auto”)height: Height (pixels or “auto”)caption: Captionvisible: Show/hide
video - Video Display
A field for displaying videos (display only, not input).
### Explanation Video
#type video
#src "https://example.com/explanation.mp4"
#width 400
#caption "Service Introduction Video"Supported Properties:
src: Video URLwidth: Width (pixels or “auto”)height: Height (pixels or “auto”)caption: Captionvisible: Show/hide
Other
boolean - Yes/No Selection
A yes/no (true/false) selection field.
### Email Subscription
#type boolean
#onLabel "Yes, subscribe"
#offLabel "No thanks"
#default falseSupported Properties:
onLabel: Label for true stateoffLabel: Label for false statedefault: Default valuerequired: Required selectionvisible: Show/hide
section_header - Section Header
A display-only heading within a section.
### Important Notice
#type section_header
#title "About Personal Information Handling"
#subtitle "Please read the following information carefully"Supported Properties:
title: Main titlesubtitle: Subtitlevisible: Show/hide
Guide to Selecting Question Types
Text Input Selection
- short_text: Names, titles, short answers (single line)
- long_text: Opinions, comments, detailed explanations (multiple lines)
- email: Email addresses (with format validation)
- phone: Phone numbers
Selection Type Selection
- radio: Few choices (2-5) for single selection
- dropdown: Many choices (6+) for single selection
- checkbox: When multiple selections are needed
Rating Type Selection
- rating: Intuitive star rating (single item)
- likert: Multiple items on same scale
- scale: Continuous numeric rating
- matrix: Complex evaluation (rows × columns)
Usage Notes
Important Notes
1. Required Properties
The #type property is required for all question types:
### Question
#type short_text # Requiredv2 Note: The content of
### headingis stored in thelabelfield (in v1 it was indescription). When accessing types, useelement.label.
2. Property Order
There is no restriction on property order, but it’s recommended to write #type first:
### Question
#type short_text
#required true
#placeholder "Enter text"3. Unsupported Properties
Some properties are not supported by certain question types. Unsupported properties are ignored.
Next Steps
After understanding question types, check the following pages for more details:
- Properties Reference - Detailed explanations of each property
- Examples - Real-world usage examples and best practices
- Type Definitions - Details of TypeScript type definitions