Back to view formats
View formattingSharePoint Online

Recent Comments

This sample shows text from the most recent items by showing them in decresing sizes as they get older.

comments
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": "flex",
      "flex-direction": "column"
    },
    "children": [
      {
        "elmType": "div",
        "txtContent": "[$Title]",
        "attributes": {
          "class": "='ms-fontColor-neutral' + if(@rowIndex==0,'Primary',if(@rowIndex==1,'Secondary','Tertiary')"
        },
        "style": {
          "font-size": "=if(@rowIndex==0,'42px',if(@rowIndex==1,'28px','16px')",
          "padding-bottom": "8px"
        }
      }
    ]
  }
}

From the contributor

How to use this sample

Summary

This sample shows text from the most recent items by showing them in decresing sizes as they get older. This is very helpful for a quick summary view of a list and is great for adding directly to a page.

screenshot of the sample

View requirements

Type Internal Name Required
Single line of text Title Yes

The view itself is sorted by Created in descending order (Newest to Oldest) and has an Item Limit of 3.

Sample

Solution Author(s)
recent-comments.json Chris Kent

Version history

Version Date Comments
1.0 April 4, 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.


Additional notes

None