Containers define the appearance and flow for large areas of the user interface. The most common and basic configurator page layout is one simple list of fields, elements, and buttons read from the top down. In many cases, this simple and straightforward design is appropriate. However, containers are useful to create multi-column layouts, or to change the direction of how page items flow to fill the screen.
Example UI | Containers used to create this UI |
---|---|
None. The default flow of a page is seen here: each item takes up the full horizontal space, and they appear top-to-bottom. | |
Create a "row" container with horizontal layout, and place the fields within the container. Now those same fields appear left-to-right. | |
Containers are themselves a layout object, so you can nest containers within containers to create a sophisticated UI, like this grid example.
|
|
Grids can also be built in the other direction, where a "column" container is repeated as many times as necessary. The sky's the limit! Create as complex a UI as you need to gather the information required. |
Add a Container
To add a container to your UI, first select any existing layout element in the design tree as the parent of the container. Then click on the '+' button. Select "Container".
Container Properties
Property | Description |
---|---|
Name | A name which is shown in the design tree and referenced in Snap rules. The name must be unique within the configurator. |
Placeholder for configurator content | By marking this element as a placeholder, you will be able to specify the children of this element in configurators that utilize this layout. See Elements as placeholders for configurator content for more details. |
Visible | Show or hide this element from display. |
Item Layout | Specify how multiple items inside this container will appear on-screen:
|
Item Alignment | Controls how the items of the container are aligned in the cross axis of the layout. If ItemLayout is set to horizontal, then this controls the vertical alignment of the items. If ItemLayout is set to vertical, then this controls the horizontal alignment of the items.
|
Item Justify |
Controls how the items of the container are aligned in the main axis of the layout. For example, if Item Layout is set to horizontal, then this controls the horizontal alignment of the items. If Item Layout is set to vertical, then this controls the vertical alignment of the items.
|
Collapse on Mobile | Containers with horizontal flow may have so many items in them that smaller screens cannot fit the items. Check this box to allow the container's horizontal flow to be relaxed on mobile devices, allowing items to render one beneath the other if space requires. |
Scroll |
If the container exceeds the size of the screen, should scrollbars appear? In most cases, additional scrollbars confuse users. But if required, they can be controlled here:
|
Padding Properties
Property | Description |
---|---|
Padding | How much relative space should be added around the container itself? This helps separate the container from other items around it. |
Space Between Items | How much relative space should be added around each item within the container? This helps separate each item within the container from other items in that same container. |
Style Properties
Property | Description |
---|---|
Background Color | Containers can have a background color to help differentiate them from other items. The colors available are defined in the overall themes of your application. |
Background Color shade | After selecting a color, you can lighten or darken it to various levels. |
Elevation | Elevation controls the size of a subtle drop-shadow that appears around the container. The drop-shadow calls attention to the container, as it makes the container appear closer to the user. |
Position
Container-based position properties appear for this interface element when it is placed within a container, giving you more control over it's position. If you place this UI element within a container, the following properties will appear. Remove it from the container, and these properties will disappear. Furthermore, the actual position properties themselves change, depending on that parent container's Item Layout.
- Not seeing any of the "Position" properties below for this UI element?
Place this element into a container, and then return to this element's properties list. The "Position" accordion will now appear in the properties list.
- Not seeing the right kinds of "Position" properties for this UI element?
Change the parent container's item layout to horizontal, vertical, or absolute. Then return to this UI element. The position properties available for items within that layout (marked by green checkmarks below) will appear.
Property | Available in a horizontal layout | Available in a vertical layout | Available in an absolute layout | Available in an absolute layout |
---|---|---|---|---|
Relative Size |
When using relative sizes, try setting all items within the container to the relative size of "x1" as a starting point, and then adjust the xN levels as necessary. Mixing items with "auto" and "xN" settings is allowed, but may be difficult to manage. |
|||
Alignment |
Controls how this item within a container is aligned in the cross axis of the container's layout.
|
|||
Left Top Right Bottom Width Height |
The distance between the edge of the parent container and this element. By default, each is "auto". Usually, you would set only 2 of these properties, leaving the rest to "auto", or you may distort this image or element. For example, to align an item's upper-right corner to the upper-right corner of the parent container, set "Top" to 0px, and "Right" to 0px, leaving all other distances to "auto". |
|||
Opacity |
The visibility of items or backgrounds behind this item. Use any decimal number from 0 to 1. Set to 0 to make this item completely transparent. Set to 1 to make the item completely opaque. |
|||
Order |
Specifies the order in which this item is drawn in the container. Use a whole number, such as 0 or 132. Default: 0. Larger numbers are drawn later, and appear closer to the user.
|
|||
Use Zero Padding | By default, UI elements have some padding around them for legibility on all devices, and for ease of use on touch-enabled devices. However, in some cases you may want specific UI elements to have no padding around them at all (to touch each other). This can be useful to create a portion of your UI which needs a very high information density. For example, to create a grid of fields that appear like cells in a spreadsheet. |