Fig Docs
  • 🏠Welcome to Fig
  • 👋Get Started
    • Download and Install
    • `fig home`
      • My Apps
      • The Sidebar
      • Settings
    • The Fig App Store
    • Hotkeys
  • 💪Autocomplete
  • 😀The Fig CLI
    • 1. Fig Overrides
    • 2. Fig Aliases
    • 3. $FIGPATH
    • 4. Fig Apps
  • 📖Interactive Runbooks
    • Form Elements
      • Input
      • Textarea
      • Dropdown
      • Checkboxes
      • Buttons
    • Templating & Interpolation
    • Scripting Language (Psilo)
      • Full List of Functions
    • Running Runbooks
    • Full Examples
  • ⚒️ Build your own CLI
    • `fig build`
    • .fig Files
  • 🧰Build your own App
    • Get Started
    • App Lifecycle
    • Key Concepts
      • Running Shell Commands
      • Reading Environment Variables
      • Accessing Files & Saving Data
      • Loading Local Resources
    • Window Managment
      • Setting Window Properties
      • Repositioning the Window
      • Focusing & Blurring the Window
    • Advanced
      • Creating a Pseudo-Terminal Session
  • Other
    • Fig for Teams
    • Security & Privacy
    • FAQ
    • Contact Us
  • Interactive Runbooks
Powered by GitBook
On this page
  • Important
  • Examples
  1. Interactive Runbooks
  2. Form Elements

Checkboxes

%[identifier: value ]{ default_value }

Important

  • A checkbox with a unique identifier outputs a boolean (true / false)

  • Multiple checkboxes with the same identifier outputs an array of selected values

Examples

### Checkbox with unique identifier = String
(Do not include placeholders)
%[test_1: ]{ true } Test 1
Test 1: {{ test_1 }}

%[test_2: ]{ false } Test 2
Test 2: {{ test_2 }}



### Multiple Checkboxes (same identifier) = Array
%[flags: --fast]{ false } fast
%[flags: --quiet]{ false } quiet
%[flags: --test]{ false } test

Flags: {{ flags }}
First Element: {{ flags[0] }}
{{flags && flags.includes("--quiet") ? "Quiet" : "Not Quiet"}}

All:
`fig acme {{flags ? flags.join(" ") : ""}}`

PreviousDropdownNextButtons

Last updated 4 years ago

📖