Widget Core Function
UI Experience: Toggle true/false interface for the userData Organization: Provides users with exactly two choices to select from, storing the selected data for use in other widgets.
Key Features
- Simple binary choice interface (Yes/No, True/False, On/Off)
- Clean, intuitive user experience for boolean decisions
- Stores selection as index (0 or 1) for use in calculations
- Supports custom labels for both toggle states
Video Tutorial
Create a Toggle
Watch Tutorial
Learn how to create and configure toggle widgets step by step
Visual Presentation

Configuration
Example Code
Configuration Parameters
Set to “lookup” to define the widget type
Set to
true for toggle widgets to display as radio buttons instead of dropdownSimple array with one column definition for the toggle options
Two-row matrix with the toggle options. Typically [“No”] and [“Yes”] or [“False”] and [“True”]
Should be set to
false for toggle widgets as autosize is not applicableCommon Toggle Patterns
Yes/No Toggle
True/False Toggle
On/Off Toggle
Custom Labels
Examples from Current Calculators
| Reference ID | Calculator Link |
|---|---|
| lookup (SW_flag) | Steel Beam Calculator |
Usage in Calculations
Toggle widgets return index values (0 or 1) that can be used in boolean logic:Conditional Logic Examples
Visibility Control
Best Practices
-
Clear Labels: Use descriptive labels that make the choice obvious to users
- Good: “Yes” / “No”
- Good: “Required” / “Not Required”
- Avoid: “True” / “False” (less user-friendly)
-
Default Values:
- Set
defaultValue: "0"for the safer/more conservative option - Consider which choice users will select most often
- Set
-
Boolean Logic: Remember that toggles return indices (0, 1), not boolean values
- Use
== 1for “true” checks - Use
== 0for “false” checks
- Use
-
Conditional Visibility: Use toggles to control visibility of related widgets
- Documentation: Include clear author notes explaining what each toggle state represents
Integration Patterns
Controlling Widget Visibility
Conditional Calculations
Troubleshooting
Common Issues:
- Forgetting to set
radioListDisplay: true(widget will appear as dropdown instead of toggle) - Using boolean values instead of string arrays in dataTable
- Comparing toggle values as booleans instead of indices (0, 1)
Remember: Toggle widgets are implemented as lookup widgets with exactly two options and radio button display enabled. This provides the clean toggle interface while maintaining the flexibility of the lookup widget system.