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
ThechoiceInput method creates radio button inputs for single selections or checkbox inputs for multiple selections. It provides a clean interface for users to choose from a predefined set of options.
Method Signature
Parameters
The unique identifier for this input field. Used to reference the selected value(s) in form submissions.
Required Parameters
The main question or label displayed to the user.
Array of choices as strings or objects with
label and value properties.Input-Specific Parameters
When set to
true, allows multiple selections using checkboxes instead of radio buttons.When set to
true, displays choices horizontally instead of vertically.When set to
true, hides the question and description, showing only the choices.Array of pre-checked choice values (must match the
value property).Shared Parameters
All standard form field parameters are supported. See textInput for the complete list includingrequired, description, fieldSize, disabled, and more.
Examples
- Single Choice (Radio)
- Multiple Choice (Checkboxes)
- Advanced Usage
Choice Types
Single Selection (Radio Buttons)
Single Selection (Radio Buttons)
Multiple Selection (Checkboxes)
Multiple Selection (Checkboxes)
Set
multiple: true to allow users to select multiple options.When to use:- Non-exclusive options (multiple can be true)
- Feature selections
- Interest categories
- Permission settings
- Multi-select preferences
Layout Options
- Vertical (Default)
- Horizontal
Choices are stacked vertically, which is ideal for:
- Longer choice labels
- Many options (5+)
- Small screen sizes
Use Cases
Product Selection
Let users choose product variants, sizes, or options.
Survey Questions
Create survey forms with single or multiple choice questions.
Preferences
Collect user preferences and settings.
Agreement Forms
Get consent or agreement through yes/no choices.
Best Practices
Choice ordering
Choice ordering
Order choices logically:
- Alphabetical for long lists
- Most common to least common
- Smallest to largest (sizes, numbers)
- Chronological (dates, time periods)
Choice labels
Choice labels
Keep labels clear and concise:
- Use parallel structure
- Be specific and unambiguous
- Avoid jargon unless necessary
- Keep length consistent when possible
When to use vs. select box
When to use vs. select box
Use choiceInput when:
- 7 or fewer options
- Users need to see all options at once
- Visual comparison is important
- 8 or more options
- Saving space is important
- Options are well-known (like countries)
Multiple selections
Multiple selections
When using
multiple: true:- Indicate in the description that multiple selections are allowed
- Consider pre-selecting common or recommended options
- Don’t require selection if users may want none
Return Value
Returns a string containing the Forms.md markup for the choice input field. Single selection returns: The value of the selected choice (string) Multiple selection returns: Array of selected choice values (string[])Related Methods
selectBox
Dropdown selection for longer lists
pictureChoice
Visual choice selection with images
ratingInput
Star or heart rating scales