Forum Discussion

virendrak's avatar
virendrak
Steel Contributor
Jun 20, 2026
Solved

Add action buttons per row in the document library / List to minimize clicks

We would like to add action buttons against each item in the SharePoint document library (e.g., Open, Edit, Share, Copy Link) to reduce the number of clicks for end users. This will improve usability, especially for users on different screen resolutions who may have difficulty locating the appropriate commands in the toolbar or context menu.

  • To improve usability and reduce the number of clicks for end users, we can add inline action buttons (such as Open, Edit, Share, and Copy Link) directly against each item in the SharePoint document library using JSON column formatting.

    This approach allows users to access commonly used actions with a single click, instead of navigating through the command bar or context menu.

    JSON Formatting (Column Formatting):
    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "style": {
        "display": "flex",
        "gap": "8px"
      },
      "children": [
        {
          "elmType": "button",
          "style": {
            "background-color": "#0078d4",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Open"
          },
          "customRowAction": {
            "action": "defaultClick"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "OpenFile"
              }
            }
          ]
        },
        {
          "elmType": "button",
          "style": {
            "background-color": "#107c10",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Edit"
          },
          "customRowAction": {
            "action": "editProps"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "Edit"
              }
            }
          ]
        },
        {
          "elmType": "button",
          "style": {
            "background-color": "#5c2d91",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Share"
          },
          "customRowAction": {
            "action": "share"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "Share"
              }
            }
          ]
        },
        {
          "elmType": "button",
          "style": {
            "background-color": "#d83b01",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Copy link"
          },
          "customRowAction": {
            "action": "copyLink"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "Link"
              }
            }
          ]
        }
      ]
    }

     

3 Replies

  • virendrak's avatar
    virendrak
    Steel Contributor

    To improve usability and reduce the number of clicks for end users, we can add inline action buttons (such as Open, Edit, Share, and Copy Link) directly against each item in the SharePoint document library using JSON column formatting.

    This approach allows users to access commonly used actions with a single click, instead of navigating through the command bar or context menu.

    JSON Formatting (Column Formatting):
    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "style": {
        "display": "flex",
        "gap": "8px"
      },
      "children": [
        {
          "elmType": "button",
          "style": {
            "background-color": "#0078d4",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Open"
          },
          "customRowAction": {
            "action": "defaultClick"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "OpenFile"
              }
            }
          ]
        },
        {
          "elmType": "button",
          "style": {
            "background-color": "#107c10",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Edit"
          },
          "customRowAction": {
            "action": "editProps"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "Edit"
              }
            }
          ]
        },
        {
          "elmType": "button",
          "style": {
            "background-color": "#5c2d91",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Share"
          },
          "customRowAction": {
            "action": "share"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "Share"
              }
            }
          ]
        },
        {
          "elmType": "button",
          "style": {
            "background-color": "#d83b01",
            "color": "white",
            "border": "none",
            "padding": "4px 8px",
            "border-radius": "4px",
            "cursor": "pointer"
          },
          "attributes": {
            "title": "Copy link"
          },
          "customRowAction": {
            "action": "copyLink"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "Link"
              }
            }
          ]
        }
      ]
    }

     

  • Rob_Elliott's avatar
    Rob_Elliott
    Silver Contributor

    It's certainly possible (and not difficult) to add clickable buttons into your list or library. You add a single line of text column and then format it with JSON. Normally this would be to trigger a flow, set the value of an item in the row, do inline edits and many more actions.

    You can also format views with JSON view formatting.

    What you can do is not unlimited but you can see the different possibilities at 

    https://pnp.github.io/List-Formatting/columnsamples/

    Rob
    Los Gallardos
    Microsoft Power Platform Community Super User
    Principal Consultant, Power Platform, WSP Global (and classic 1967 Morris Traveller driver)

  • sarahcollins's avatar
    sarahcollins
    Copper Contributor

    Good suggestion. Adding quick action buttons per row would improve usability and reduce clicks, especially for non-technical users or smaller screen resolutions.