Skip to main content
The Checkbox field is a simple checkbox element that returns either True or False in the API, useful for feature flags and visibility toggles.

Field at a glance

Input and output

Input type

Checkbox element

API output

boolean

API response example

Field configuration options

Checking the default value box in the field configuration options will set the field as True by default.

Common use cases

  • Setting whether content should be featured or highlighted on a page
  • Including content in site navigation or mobile-specific display
  • Enabling comments, social sharing buttons, related posts, or newsletter forms
  • Indicating whether items are in stock, on sale, new, or part of a promotion
  • Showing or hiding sidebars, optional themes, dark mode, breadcrumbs
Use descriptive field names that indicate the “true” state. Names like is_featured, show_sidebar, or enable_comments make it clear what checking the box does.

Working with booleans in your application

Content like Collections and Pages can even be filtered by your Checkbox fields when queried from the API via the fields. query parameter, e.g., fields.is_featured=True

JavaScript example

Filtering by boolean

Python example

Best practices

  1. Use descriptive names: The field name should clearly indicate what True means
  2. Set appropriate defaults: Think about what the “normal” state should be: is_featured would likely be False, include_in_shop would likely be True, etc.
  3. Provide help text: Explain what happens when the checkbox is checked
  4. Group related booleans: If you have many toggles, consider using components
  5. Don’t overuse: Too many checkboxes can be overwhelming for editors