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
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
The step-by-step guide spells out every click, with pictures. In short:
- Click Build this Yes/No toggle above. It opens the step-by-step guide with the Yes/No switch design already picked. For a to-do list look, use Checkbox To-Do instead.
- In step 2, type your Yes/No column’s name. (Checkbox To-Do also lets you pick the Done color.)
- No Yes/No column yet? Step 3 shows exactly how to add one.
- Click Copy my code.
- In your list, click the name at the top of your column, then Column settings, then Format this column. At the bottom of the panel that opens, click Advanced mode.
- Click inside the box, press Ctrl+A and then Delete to empty it, and press Ctrl+V to paste. Click Preview, then Save.