SharePoint column formatting

SharePoint Yes/No column formatting

SharePoint's default Yes/No column renders as a tiny checkbox icon that's easy to miss when scanning a list. Column formatting JSON turns it into a clear toggle switch or checkbox instead.

A Yes/No (boolean) column stores true or false, but by default SharePoint just shows a small checked or unchecked box — no color, no label. With column formatting JSON, you can render it as a colored toggle switch, a checkbox with a strikethrough label, or any other visual you want.

Before and after

TaskDone
Submit budget
Review draft
Plan offsite
Green + right = Yes · grey + left = No
Build this Yes/No toggle → Opens the generator on the Yes/No Toggle template. A checkbox-style option is also available.

What the SharePoint Yes/No JSON looks like

The generator produces JSON like the example below. The field's boolean value drives both the switch position and its color:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "width": "34px", "height": "18px", "border-radius": "20px",
    "background-color": "=if([$Done] == 1, '#107c10', '#c8c6c4')",
    "position": "relative"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "width": "14px", "height": "14px", "border-radius": "50%", "background-color": "white",
        "position": "absolute", "top": "2px",
        "left": "=if([$Done] == 1, '18px', '2px')"
      }
    }
  ]
}

This is standard SharePoint boolean column formatting JSON: the field value (1 for Yes, 0 for No) is checked with if() to set both color and knob position. The generator writes this — and the click-to-edit behavior — for you.

How to apply it

  1. Open the generator and pick Yes/No Toggle (or Checkbox To-Do for a to-do list look).
  2. Enter your column's internal field name — see the note below.
  3. Adjust colors if you want something other than green/grey.
  4. Click Copy.
  5. In SharePoint: Column settings → Format this column → Advanced mode.
  6. Delete what's in the box, paste, click Preview, then Save.
Most common reason it doesn't work: the field name must match your column's internal name, which can differ from the display name. See the internal field name guide to find yours.

Common questions

What column type do I need for a Yes/No toggle?
A Yes/No (boolean) column. SharePoint stores it as true/false internally, which the JSON checks with a simple condition.
Can people still click to change the value?
Yes — the toggle and checkbox templates are click-to-edit, so clicking the cell flips the value directly in list view without opening the item.
Toggle switch or checkbox — which should I use?
Use a toggle for flags like Active/Archived or Approved/Not Approved. Use the checkbox-style template for to-do or completion lists, since it shows a strikethrough label when checked.