Introduction
Responsiveness is a key feature of any app and there are many elements in an app that need to be responsive e.g. a pop-up. One of the sample apps I created for Microsoft Teams is Profile+ (code can be found here). It is an app that shows organization structure for a selected user and also shows the list of team members in a team. We will use the filter section of the team members view to illustrate how to build a responsive pop-up using traditional containers. The focus will be on the UI and not on how to implement a filter.
Responsive pop-up using traditional containers
Add the following controls to create a responsive pop-up using traditional containers
- A label
- Name: lblFilterOverlay
- X: 0
- Y: 0
- Width: Parent.Width
- Height: Parent.Height
- Text: ""
- Fill: RGBA(0, 0, 0, 0.4)
- OnSelect: UpdateContext({locViewFilter: false})
- A container
- Name: conFilter
- X: (Parent.Width - Self.Width) / 2
- Y: (Parent.Height - Self.Height) / 2
- Width: Min(600, Parent.Width - 40)
- Height: 200
- Fill: RGBA(255, 255, 255, 1)
- A label inside the container
- Name: lblFilterHeader
- X: 20
- Y: 20
- Width: Parent.Width - Self.X - 20
- Height: 40
- Text: "Filter - Title"
- A combo box inside the container
- Name: cmbFilter
- X: lblFilterHeader.X
- Y: lblFilterHeader.Y + lblFilterHeader.Height + 20
- Width: lblFilterHeader.Width
- Height: 40
- Items: as needed
- A button inside the container
- Name: btnApplyFilter
- X: Parent.Width - Self.Width - 20
- Y: Parent.Height - Self.Height - 20
- Width: 160
- Height: 40
- Text: "Apply"
- OnSelect: UpdateContext({locFilter: cmbFilterOptions.Selected.Value, locViewFilter: false})
- Another button inside the container
- Name: btnClearFilter
- X: btnApplyFilter.X - Self.Width - 20
- Y: btnApplyFilter.Y
- Width: 160
- Height: 40
- Text: "Clear"
- OnSelect: Reset(cmbFilterOptions); UpdateContext({locViewFilter: false})
- Set the Visible property of the container and lblFilterOverlay label to locViewFilter
- Add an icon which will be used to display the filter pop-up
- Name: icnFilter
- Icon: If(IsBlank(cmbFilterOptions.Selected.Value),Icon.FilterFlat, Icon.FilterFlatFilled)
- OnSelect: UpdateContext({locViewFilter: true})
Here is a demo:
2 thoughts on “How to create a responsive pop-up using traditional containers”