I would like to apply a Tiles effect on items of the customized list.
You can find a very good code here:
https://github.com/SharePoint/sp-dev-list-formatting/tree/master/view-samples/generic-tile-format
Unfortunately, as it’s written: « To see the tiles, switch your layout to the Tiles layout. » It won’t work for my need because the layout cannot be saved in the view and I cannot tell the users to change the layout.
So I tweaked the json as follow:
{ "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json", "hideColumnHeader": "true", "hideSelection": true, "rowFormatter": { "elmType": "a", "attributes": { "href": "[$Lien]", "target": "=if([$NouvelOnglet] == true, '_blank', '')" }, "style": { "float": "left" }, "children": [ { "elmType": "div", "attributes": { "class": "ms-bgColor-themeLighterAlt ms-bgColor-themePrimary--hover ms-fontColor-white--hover" }, "style": { "display": "flex", "flex-wrap": "wrap", "min-width": "180px", "min-height": "150px", "margin-right": "10px", "margin-top": "10px", "box-shadow": "2px 2px 4px darkgrey", "float": "left" }, "children": [ { "elmType": "div", "style": { "text-align": "center", "margin": "auto" }, "children": [ { "elmType": "div", "attributes": { "class": "sp-row-title " }, "txtContent": "[$Title]" }, { "elmType": "div", "attributes": { "iconName": "[$Icone]", "class": "ms-fontSize-su" } } ] } ] } ] } }
And finaly to obtain the look of Quick links
{ "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json", "hideColumnHeader": "true", "hideSelection": true, "rowFormatter": { "elmType": "a", "attributes": { "href": "[$Lien]", "target": "=if([$NouvelOnglet] == true, '_blank', '')" }, "style": { "float": "left" }, "children": [ { "elmType": "div", "attributes": { "class": "ms-bgColor-themePrimary ms-bgColor-themeDarkAlt--hover ms-fontColor-white ms-fontColor-white--hover" }, "style": { "display": "flex", "flex-wrap": "wrap", "width": "150px", "height": "150px", "margin-right": "10px", "margin-top": "10px", "box-shadow": "2px 2px 4px darkgrey", "float": "left" }, "children": [ { "elmType": "div", "style": { "text-align": "center", "margin": "auto" }, "children": [ { "elmType": "div", "attributes": { "iconName": "[$Icone]", "class": "ms-fontSize-xxl" } }, { "elmType": "div", "attributes": { "class": "sp-row-title " }, "txtContent": "[$Title]" } ] } ] } ] } }
Sizes of font:
UI Fabric Thèmes
UI Fabric Icônes
https://developer.microsoft.com/en-us/fabric#/styles/web/icons