Back to column formats
Column formattingSharePoint Online

Rounded Fill Checkbox

This sample includes custom checkbox rounded styles.

Rounded Fill Checkbox formatting preview
Sample preview · View original animation

Copy. Apply. Make it yours.

Get this format

2 definitions

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

Column formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "div",
      "style": {
        "display": "flex",
        "padding": "2px",
        "border": "1px solid #ccc",
        "border-radius": "30px"
      },
      "children": [
        {
          "elmType": "div",
          "style": {
            "cursor": "pointer",
            "padding": "5px 0px",
            "width": "70px",
            "text-align": "center",
            "background-color": "=if([$AzureOption] != true ,'#0078d4','transparent')",
            "border-top": "=if([$AzureOption] != true ,'2px solid #0078d4','')",
            "border-bottom": "=if([$AzureOption] != true ,'2px solid #0078d4','')",
            "color": "=if([$AzureOption] != true ,'white','black')",
            "border-radius": "30px"
          },
          "attributes": {
            "class": "ms-fontColor-white"
          },
          "txtContent": "Off",
          "customRowAction": {
            "action": "setValue",
            "actionInput": {
              "AzureOption": "0"
            }
          }
        },
        {
          "elmType": "div",
          "style": {
            "width": "70px",
            "text-align": "center",
            "padding": "5px 0px",
            "cursor": "pointer",
            "background-color": "=if([$AzureOption] == true,'#0078d4','transparent')",
            "color": "=if([$AzureOption] != true,'black','white')",
            "border-top": "=if([$AzureOption] == true ,'2px solid #0078d4','')",
            "border-bottom": "=if([$AzureOption] == true ,'2px solid #0078d4','')",
            "border-radius": "30px"
          },
          "txtContent": "On",
          "customRowAction": {
            "action": "setValue",
            "actionInput": {
              "AzureOption": "1"
            }
          }
        }
      ]
    }
  ]
}

From the contributor

How to use this sample

Summary

This sample includes custom checkbox rounded styles.

screenshot of the sample

View requirements

  • The format expects the following fields:
Field Type
Title Single line of text
CheckOption Yes/No - field with rounded style
AzureOption Yes/No - field with Azure look style

Sample

Solution Author(s)
yesno-roundedfill-format.json André Lage
yesno-azure-format.json André Lage

Version history

Version Date Comments
1.0 January 07, 2022 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.