List-Formatting
List-Formatting copied to clipboard
Image - Gallery Sample
Hello,
i am looking for a sample looks like this:
I have a document library with only images.
It is possible to write a json to create something like the sample picture?
@chris883773 You can create a Gallery view and test bellow formatting, the key to appear as you want it's define on the max width or max height to assume the size of the original images. Its important that you define a max that you manage the size of image, some can be huge...
Sample formatting:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
"formatter": {
"elmType": "div",
"style": {
"padding": "20px 5px "
},
"children": [
{
"elmType": "img",
"attributes": {
"src": "[$FileRef]"
},
"style": {
"cursor": "pointer",
"border-radius": "15px",
"max-width": "200px",
"max-height": "100px"
}
}
]
}
}