Skip to main content

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.

Checkbox inputs are created using the choiceInput method with the multiple parameter set to true.

Overview

Checkboxes allow users to select multiple options from a list of choices. They are implemented using the choiceInput method with multiple: true.

Creating Checkboxes

To create checkbox inputs, use choiceInput with the multiple parameter:
composer.choiceInput("fieldName", {
  question: "Your question here",
  choices: ["Option 1", "Option 2", "Option 3"],
  multiple: true
});

Examples

const composer = new Composer({ title: "Survey Form" });

composer.choiceInput("interests", {
  question: "What are your interests?",
  choices: ["Technology", "Design", "Marketing", "Sales"],
  multiple: true,
  required: true,
  description: "Select all that apply"
});

Common Use Cases

Preferences

Collect user preferences where multiple options can be selected.
choices: ["Email", "SMS", "Push", "In-app"]
multiple: true

Features

Let users choose multiple features or add-ons.
choices: ["Feature A", "Feature B", "Feature C"]
multiple: true

Interests

Gather multiple interest categories from users.
choices: ["Sports", "Music", "Travel", "Food"]
multiple: true

Permissions

Configure permission settings with multiple selections.
choices: ["Read", "Write", "Delete", "Admin"]
multiple: true

Key Parameters

multiple
boolean
required
Must be set to true to render checkboxes instead of radio buttons.
choices
(string | ChoiceOptionType)[]
required
Array of checkbox options as strings or objects with label and value.
checked
string[]
Array of pre-checked values. Values must match the choice values.
horizontal
boolean
Display checkboxes horizontally instead of vertically.
For all available parameters, see choiceInput documentation.

Single Checkbox Pattern

For a single checkbox (like accepting terms), use a single-item choice:
composer.choiceInput("terms", {
  question: "Do you agree to our terms?",
  choices: ["I agree to the terms and conditions"],
  multiple: true,
  required: true
});
For a simple yes/no question, use radio buttons (single selection) instead:
composer.choiceInput("terms", {
  question: "Do you agree to our terms?",
  choices: ["Yes, I agree", "No"],
  required: true
});

Return Value

When submitted, checkbox selections return an array of selected values:
// If user selects "Technology" and "Design"
{ interests: ["Technology", "Design"] }

// With custom values
{ notifications: ["updates", "newsletter"] }

// Empty array if nothing selected
{ preferences: [] }

Best Practices

Make it obvious that multiple selections are allowed:
description: "Select all that apply"
description: "Choose as many as you like"
description: "Pick multiple options"
Pre-select commonly chosen or recommended options:
checked: ["email"],  // Most users want email notifications
description: "Email notifications are recommended"
Too many checkboxes can be overwhelming:
  • Ideal: 3-7 options
  • Maximum: 10-12 options
  • If more needed, consider grouping or using a different input type

choiceInput

Complete choiceInput API reference

pictureChoice

Multiple selection with images

Build docs developers (and LLMs) love