The Checkbox field is a simple checkbox element that returns either True or False in the API, useful for feature flags and visibility toggles.Documentation Index
Fetch the complete documentation index at: https://buttercms.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Field at a glance
Input and output
Input type
Checkbox element
API output
booleanAPI response example
Field configuration options
Option name | Type | Function |
|---|---|---|
| Required? | boolean | Make field required to save page |
| Help text | string | Add help text to describe usage to your team |
| Default value | string | Set a default value for the field |
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
Working with booleans in your application
JavaScript example
Filtering by boolean
Python example
Best practices
- Use descriptive names: The field name should clearly indicate what
Truemeans - Set appropriate defaults: Think about what the “normal” state should be:
is_featuredwould likely beFalse,include_in_shopwould likely beTrue, etc. - Provide help text: Explain what happens when the checkbox is checked
- Group related booleans: If you have many toggles, consider using components
- Don’t overuse: Too many checkboxes can be overwhelming for editors