Back to view formats
View formattingSharePoint Online

Highlighted Announcements

A list formatting style that visually emphasizes important announcements.

Highlighted Announcements formatting preview
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

1 definition

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.

View formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "hideColumnHeader": true,
  "hideSelection": true,
  "rowFormatter": {
    "elmType": "div",
    "style": {
      "display": "=if([$Display] == true, 'flex','none')",
      "flex-direction": "row",
      "align-items": "stretch",
      "margin": "0 6px 16px 4px",
      "border-radius": "8px",
      "box-shadow": "0px 1.6px 3.6px 0px rgba(0,0,0,0.13), 0px 0.3px 0.9px 0px rgba(0,0,0,0.11)",
      "overflow": "hidden"
    },
    "children": [
      {
        "elmType": "a",
        "attributes": {
          "href": "[$Link]",
          "target": "=if([$Link] == '', '', '_blank')"
        },
        "style": {
          "display": "flex",
          "align-items": "center",
          "justify-content": "center",
          "width": "60px",
          "flex-shrink": "0",
          "text-decoration": "none",
          "background-color": "=if([$IconBackground] == '', 'gray', [$IconBackground])"
        },
        "children": [
          {
            "elmType": "div",
            "attributes": {
              "iconName": "[$IconName]"
            },
            "style": {
              "color": "white",
              "font-size": "24px"
            }
          }
        ]
      },
      {
        "elmType": "div",
        "style": {
          "padding": "10px 5px 10px 14px",
          "display": "flex",
          "flex-direction": "column",
          "justify-content": "center",
          "flex-grow": "1",
          "background-color": "[$DescriptionBackground]"
        },
        "children": [
          {
            "elmType": "div",
            "txtContent": "[$Title]",
            "style": {
              "font-weight": "600",
              "font-size": "16px",
              "color": "black",
              "margin-bottom": "4px"
            }
          },
          {
            "elmType": "div",
            "txtContent": "[$Description]",
            "style": {
              "font-size": "14px",
              "color": "#545559",
              "margin-bottom": "6px"
            }
          }
        ]
      }
    ]
  }
}

From the contributor

How to use this sample

Summary

A SharePoint list formatting sample that visually emphasizes important announcements to draw attention using custom icons, background colors, titles, descriptions, and links, inspired by the announcements sample.

screenshot of the sample

View requirements

Column Name Type Decription
IconName Single line of text https://www.flicon.io
IconBackground Single line of text Hex color code
Title Single line of text Announcement title
Description Single line of text Announcement description
DescriptionBackground Single line of text Hex color code
Link Hyperlink Announcement detail
Display Yes/No Show or hide announcements

[!NOTE] It is necessary to include the columns in the view or it won't work as excpected.

field mapping

Sample

Solution Author(s)
highlighted-announcements.json Watana

Version history

Version Date Comments
1.0 August 24, 2025 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.