Loading...

Series: Build Power Apps that don't look like Power Apps - Material Design part 2

Series: Build Power Apps that don't look like Power Apps - Material Design part 2

For real, your low code apps don’t need to look like as if design wasn’t important. I hear lots of people say, that they suck at design or don’t have an eye for good UX. But a visually appealing UI is not the cherry on the cake but one of the core tasks of everyone who builds apps. Let me guide you step by step how you can improve your design skills - we will be again leveraging Google’s Material Design system. This is part 2 of How to build Power Apps - that don’t like Power Apps. If you didn’t read part 1 yet, this is your chance to catch up :-)

Why do we use Material Design? It’s

  • goodlooking
  • well documented
  • widely used

Also: If we can build Google/Android look-a-like apps with Microsoft Power Apps, we can build everything :-)

This blog post focuses on how to create those beautiful Material Design quilted image lists in Power Apps galleries.

Material Design gallery in Power Apps

This is the schema that we are aiming for: it consists of 4 types of rows which hold different amount of images in different widths and x positions.

gallery schema

Create a component

Let’s do this properly and create a canvas component cmp_MD_Gallery with the following custom properties:

  • singleImageWidth: 200
  • imagePadding: 10

Now let’s take care of how to feed our gallery. Create an additional custom property galleryContent in the component of type Table:

Table(
//row 1, 3 images
{
id: 1,
image: "<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
{
id: 2,
image:"<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
{
id: 3,
image:"<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
// row 2, 2 images (1st 2/3, 2nd 1/3)
{
id: 4,
image: "<link to your image goes here>",
width: 2 * (cmp_MD_Gallery.singleImageWidth) + cmp_MD_Gallery.imagePadding
},
{id: 5},
{
id: 5,
image: "<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
//3rd row - 1 image
{
id: 6,
image: "<link to your image goes here>",
width: 3 * (cmp_MD_Gallery.singleImageWidth) + 2 * ( cmp_MD_Gallery.imagePadding)
},
{id: 7},
{id: 8},
//4th row - 2 images (1st 1/3, 2nd 2/3)
{
id: 7,
image: "<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
{
id: 8,
image: "<link to your image goes here>",
width: 2 * (cmp_MD_Gallery.singleImageWidth) + cmp_MD_Gallery.imagePadding
},
{id: 9},
//5th row - 3 images
{
id: 9,
image: "<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
{
id: 10,
image: "<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
{
id: 11,
image: "<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
//6th row -rest
{
id: 12,
image: "<link to your image goes here>",
width: cmp_MD_Gallery.singleImageWidth
},
{
id: 13,
image: "<link to your image goes here>",
width: 2 * (cmp_MD_Gallery.singleImageWidth) + cmp_MD_Gallery.imagePadding
}
)

As you notice, we leave some items blank to make room for items that span the width of two items.

  1. Create a vertical gallery, set its Width to Parent.Width, its Height to 1000, its TemplateSize to 300
  2. Set the the Items to cmp_MD_Gallery.galleryContent
  3. Insert an image into the gallery, set its Height to Parent.TemplateHeight
  4. Set the Image property of the image to ThisItem.image
  5. Set the Width property of the image to ThisItem.width

Create the invisible scrollbar

If you want to create an invisible scrollbar

  1. add a vertical slider on top of the gallery, set its Max to 0 and its Min to -1000, and its Height to Gallery1.Height
  2. Set all its colors to Transparent to make it disappear, but don’t set Visible to false (Users can’t interact with a control that has that setting)
  3. Set the Y of the Image to Slider1.Value - boom, done 🚀

You can set the Width of the slider and the Size of the Handle to the Width of the gallery if users shall use the entire gallery width to scroll or you can limit this and give them a visual cue (a button, circle, etc) so that they know that they can scroll here.

Feedback and what’s next

As you can see, its relatively easy to create an engaging UX in Power Apps. When discussing this with the Math & SVG magician Robin RosengrĂĽn, he found an even more elegant way to calculate widths and x positions of each image, hope he records a video on that soon - #TeamWorkMakesTheDreamWork

Would you try this gallery in your Power Apps? Let me know what you think on twitter.

If you found this blog post useful, please also subscribe to my newsletter - news coming about every 2 months, I promise to not spam you! Next blog post in this series is how to create basic UI elements that you will love.

Published on:

Learn more
Luise Freese: Consultant & MVP
Luise Freese: Consultant & MVP

Recent content on Luise Freese: Consultant & MVP

Share post:

Related posts

You are holding GitHub Copilot Wrong!

Part 0 showed why constant prompting, re-prompting, and steering GitHub Copilot feels fragile. Not because Copilot is unreliable, but because ...

7 months ago

You are holding GitHub Copilot Wrong!

Most developers think that one can’t really use GitHub Copilot wrong. There is a chat interface that lets you also choose a model, so th...

7 months ago

Building a Multi-Hierarchy Ticket Classification System (Because Keywords Aren't Enough)

Look, I love a good keyword-based system as much as the next developer. They’re fast, predictable, and when your user says “VPN,&r...

8 months ago

Secretless cross-tenant dataverse access

Client secrets are like hiding your house key under the mat; easy to grab and impossible to audit. Certificates are just slightly better, beca...

9 months ago

How Azure CLI handles your tokens and what you might be ignoring

Running az login feels like magic. A browser pops up, you pick an account, and from then on, everything just works. No more passwords, no more...

9 months ago

How Dev Proxy teaches you to make your apps more resilient

I added Microsoft Dev Proxy to my Mermaid → Dataverse converter, because I wanted to test how it handled rate limits and API errors. What I go...

10 months ago

Building Azure functions that never store secrets — ever

What if your function could hit Microsoft Graph with no client secrets, no certs, and no Key Vault entries? That is exactly what a Managed id...

10 months ago

Introducing Mermaid to Dataverse Converter

Why diagrams matter (and why they usually fail us) Entity-Relationship Diagrams (ERDs) are the universal shorthand for talking about data mode...

11 months ago

It’s OK to be seen trying

It’s OK to be seen trying Somewhere along the way, we started believing that you’re only allowed to speak after you’ve figured everything out....

1 year ago

Stuck in pilot - Part 1: no foundations, no future

“We just need to test the AI. We’ll figure out the data later.” That sentence has quietly killed more AI pilots than any model failure ever ...

1 year ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy