Containers and responsive layout
A container groups elements and controls their flow, spacing, alignment, appearance, and scrolling. The page arranges its containers; each container arranges its own elements. Start with this structure before adjusting individual controls.
The examples below show the visual editor in VS Code and NG Live Preview. Their buttons demonstrate layout; navigation and hardware actions must be configured separately.
Add and configure a container
- Open a saved
.pagefile in the visual editor. - Run AVstudio: Add container, or use Add container from the canvas context menu.
- Select the container and open Container Properties.
- Give it a useful name, such as
Header,RoomControls, orSourceList. - Configure its layout, then add elements inside it using Add element.
- Save and open Open Live Preview (Browser) to inspect the result.
For the illustrated insertion workflow, see Add components to a project. Select the container itself when changing its layout; selecting a Button or Slider opens that element's properties instead.
Understand the two layout levels
| Level | What it arranges | Example |
|---|---|---|
| Page flow | Top-level containers | Stack a header above content, or place a sidebar beside content |
| Container flow | Elements within one container | Place source buttons in a row or stack menu buttons vertically |
A column page can contain a row header and a column content area. The directions are independent.
All containers belong directly to the page's containers array. A container's elements array contains elements, not other containers. If one area needs a more complex internal layout, embed a Subpage that has its own containers.
Flow, alignment, and distribution
Choose Horizontal or Vertical flow
- Horizontal (Row) lays out elements side by side. It suits a toolbar, source selector, or a group of adjacent controls.
- Vertical (Column) stacks elements from top to bottom. It suits a menu, settings panel, or list of controls.
The screenshots below show the current controls in VS Code. Open Container Flow Demo.page in the sample project to follow along. Its responsive page stacks two containers; each holds the same Audio, Video, and Lights buttons, sized 150 × 60 px.
- Select the upper container on the canvas and open Container Properties from the Activity Bar. Check Container name reads Row controls.
- Expand Container layout. Under Flow, select Horizontal.
- Set Align and Distribution to Center, and Gap between elements to 16 px. The buttons form a centered row.
Horizontal flow: the selected upper container places Audio, Video, and Lights side by side. The sidebar shows the settings that produce this arrangement.
- Select the lower container. Check Container name reads Column controls.
- Under Flow, select Vertical. Keep Align, Distribution, and Gap between elements unchanged. The same buttons now form a centered column.
Vertical flow: the lower container stacks the same buttons. Align centers them horizontally; Distribution centers the group vertically.
To see the change directly, switch the lower container to Horizontal, then back to Vertical. Its buttons rearrange without changing their size or order. Save the page when finished. The page's flow arranges the containers; each container's Flow arranges its own elements.
Align across the flow
Alignment (align) controls the axis perpendicular to the flow:
| Alignment | In a Row | In a Column |
|---|---|---|
flex-start | Align to the top | Align to the left |
center | Center vertically | Center horizontally |
flex-end | Align to the bottom | Align to the right |
stretch | Let eligible elements fill the available height | Let eligible elements fill the available width |
An explicitly sized element can prevent the stretching you expect. Check the element's width, height, and minimum/maximum limits when it does not follow the container alignment.
Distribute along the flow
Distribution (distribution) controls the direction in which the elements are arranged:
| Distribution | Behavior |
|---|---|
flex-start | Group items at the beginning: left in a row, top in a column |
center | Center the group |
flex-end | Group items at the end: right in a row, bottom in a column |
space-between | Put the first and last items at opposite ends and distribute remaining space between items |
space-around | Distribute space around the items |
For a header with a title and a Home button, use Row, alignment Center, and distribution Space between. For a vertical list that can overflow, use Column and distribution Start so its beginning remains easy to reach.
Spacing: page gap, container gap, and padding
| Setting | Space it controls | Typical use |
|---|---|---|
Page gap | Between containers | Separate the sidebar and content regions |
Container gap | Between elements in that container | Give a row of buttons consistent separation |
| Container padding | Between the container edge and its content | Keep controls away from borders and screen edges |
| Spacer element | One specific gap or decorative shape | Separate two groups or draw a divider |
Use the parent container's gap for repeated spacing. A Spacer is useful when a particular gap differs from the others.
For example:
Set Gap to 16 px, all-sides padding to 24 px, and top and bottom padding to 12 px in Container Properties.
The side-specific padding values override the all-sides value. This example uses 24 px on the left and right, and 12 px on the top and bottom.
Compose a responsive page
A responsive page fills the viewport. Divide that space into containers that either share available space or keep a manual size.
| Sizing choice | Configuration | Suitable regions |
|---|---|---|
| Flexible | Leave container size unset | Main content, equal columns, lists |
| Manual | Set size and enable manual mode | A fixed-height header or fixed-width sidebar |
The size direction comes from the page flow:
- In a column page, a manual container size determines its height.
- In a row page, a manual container size determines its width.
Manually sized containers take their space first. Flexible siblings share the remainder. Two flexible containers can form equal columns without calculating percentages.
A saved size.value is not enough. The size takes effect only when size.manualMode is true. When manual mode is false or absent, the container remains flexible and the saved size value is ignored at runtime.
Do not derive every container dimension from one panel resolution. Reserve manual sizing for regions that need it, and let the content use the remaining space.
Example: fixed header and flexible content
Build the structure
Open Header Scroll Demo.page in the sample project to inspect this example in VS Code, or build it as follows:
- Set the page layout to Responsive and page flow to Vertical (Column).
- Add two containers named
HeaderandContent. - Set the page gap to 16 px.
- Select
Header, open Container Properties → Container layout, choose Size → Manual, and enter 80 px. - Select
Contentand choose Size → Auto so it fills the remaining height. - Put a title and Home button in the header; add the main controls to Content.
Configure the header
Select the header on the canvas and check Container name is Header. Set Flow → Horizontal, Align → Center, and Distribution → Between. The title stays on the left and the Home button on the right. The example uses a 64 px high button with 8 px padding above and below, fitting within the 80 px header.
Set Header to a manual size of 80 px and apply 8 px padding on all sides.
Header selected in VS Code: Manual reserves an 80 px strip at the top of the responsive page.
Configure the content
Select the room-list container and check Container name is Content. In Container layout, choose Size → Auto, Flow → Vertical, Align → Center, and Distribution → Start. Expand Scroll and select Scroll so controls remain reachable when the list exceeds the available height.
Set Content’s gap to 20 px and leave its container size flexible.
The flexible Content container fills the remaining height after the header and page gap.
Content selected in VS Code: Auto uses the remaining height, while Scroll keeps the 14-button list reachable inside that region.
Scroll over the room list to reach Room 14, then return to Room 1. The header remains outside the scrolling container. Scroll inside Content when testing this behavior; panning the surrounding editor canvas moves the whole design view. Test the same list in Live Preview. These sample buttons demonstrate layout and have no navigation actions.
Use a global slot instead when the same header must appear across multiple pages. A normal header container belongs only to its own page.
Example: sidebar and two equal content columns
Open Sidebar Columns Demo.page in the sample project to inspect this arrangement, or create a responsive page with three top-level containers: Sidebar, Audio, and Lighting.
- In Page Properties, set the page flow to Horizontal (Row) and the gap between containers to 16 px.
- Select Sidebar on the canvas and open Container Properties. Expand Container layout, choose Manual under Size, and enter 240 px. Because the page flows horizontally, this sets the sidebar's width.
- Set the container's Flow to Vertical, Align to Center, Distribution to Center, and Gap between elements to 16 px. Add Audio, Video, and Lights buttons.
Sidebar uses Manual sizing to keep its 240 px width. Its Vertical flow stacks the navigation buttons.
- Select Audio and choose Auto under Size. Use Vertical flow, Center alignment and distribution, and a 16 px element gap. Add Volume and Mute buttons.
- Select Lighting and apply the same settings. Add Scene 1 and Scene 2 buttons, then save the page.
Audio and Lighting use Auto sizing and divide the remaining width equally after the sidebar and page gaps. Changing the page width keeps Sidebar at 240 px while both content columns resize.
Check that the sidebar, gaps, and minimum content widths fit the smallest intended display. Flexible sizing distributes available space; it does not automatically transform a desktop sidebar into a mobile navigation pattern.
Size elements within a container
Container size allocates a region of the page. Element width and height determine the controls within that region. Changing a Button's width does not change the container's sizing mode.
Use a fixed size when a control needs a particular touch area. Use a relative size with limits when it should adapt to its container:
In Element Properties, set width to 100%, maximum width to 400 px, and height to 64 px.
This element can occupy the available width up to 400 px, while keeping a 64 px height. Set these dimensions on the element; configure the container’s size separately.
An omitted element dimension or a null value leaves sizing to the renderer's default behavior. Consider label length, wrapping, padding, and touch target size together rather than forcing every control into identical dimensions.
Size and overflow
In a responsive layout, growing content scrolls inside its container. Do not increase the page height to accommodate a long source list or log.
scrollMode | Result | When to use it |
|---|---|---|
disabled | Overflow is hidden and cannot be scrolled | A region whose contents are guaranteed to fit |
scroll | Scrolling with a visible scrollbar | Lists where users should see that more content exists |
scrollHidden | Scrolling with the scrollbar hidden | An intentionally clean presentation with another clear scrolling cue |
An unset scroll mode inherits the active theme's container setting. scrollbarThumbBackground accepts a CSS color or auto for native system appearance. Scrollbar thickness is native; there is no container scrollbar-size property.
Test overflow with more items than the visible area can hold. Confirm that the first and last controls are reachable and that dragging or scrolling over a control produces the intended interaction.
Appearance and theme inheritance
Container properties can set the background, border, padding, text color, font family and size, text transformation, and wrapping. Use the theme for shared defaults, then add local overrides only where this container needs a different treatment.
| Property group | What to check |
|---|---|
| Background | A color or supported background image; keep controls legible over it |
| Border | Enable border settings, then set width, style, color, and radius |
| Typography | Container defaults can be overridden by individual elements |
| Padding | Enough inset for borders, labels, and touch controls |
| Scroll appearance | Local scrollbar color and mode override inherited defaults |
If a theme change appears to have no effect, check for an explicit value on the container and then on the element. See Themes and custom styling.
Responsive versus fixed pages
| Responsive page | Fixed page |
|---|---|
| Page flow arranges containers, and container flow arranges elements | Elements use explicit positioning and anchoring |
| Flexible regions adapt to the viewport | Position constraints determine how controls relate to the canvas edges |
| Start with flow, gap, alignment, and sizing | Start with coordinates and horizontal/vertical constraints |
The worked examples on this page are responsive. Do not apply fixed-position offsets as a substitute for responsive flow. See Pages and layouts before changing the layout mode of an existing design.
Reusable groups
For a room card with a title row, a content region, and a footer, create a separate page with those containers, then embed it using a Subpage element. The host container holds the Subpage element; the embedded page owns its internal containers.
Use Subpage List when that card must repeat for datasource records. Use global slots for shared regions around multiple screens. See the Subpages, lists, and global slots walkthrough.
Troubleshooting
| Symptom | What to check |
|---|---|
| Changing the saved size has no effect | Enable manual mode; check whether the page flow makes size control width or height |
| Main content does not fill remaining space | Remove an unintended manual size from that content container |
| Equal columns have unequal usable areas | Compare manual sizes, padding, gaps, and the minimum dimensions of their children |
| Stretch does not enlarge a control | Check the element's explicit dimension and minimum/maximum limits |
| Space between leaves unexpectedly large gaps | Distribution spreads remaining space in addition to the configured gap; use Start or Center for a compact group |
| First or last list items are difficult to reach | Use start distribution for the overflowing flow and check the container's Scroll setting |
| Content disappears beyond the edge | Scroll may be disabled, or the allocated region may be too small |
| Scrolling works but the bar is absent | Check for scrollHidden or a theme override |
| A nested group renders empty | A container cannot be placed directly inside another container; use a Subpage element |
| Theme changes are not visible | Inspect local container and element overrides |
| The narrow layout is crowded | Reduce unnecessary manual sizes, allow suitable text wrapping, and reconsider the arrangement for that screen size |
Verify the layout
- Save and run Run Project Health Check.
- Preview wide and narrow target sizes and both orientations.
- Confirm headers and sidebars keep their intended size while content adapts.
- Test long labels, large values, and more list items than fit on screen.
- Scroll to the first and last controls without losing access to fixed navigation.
- Check padding, contrast, clipping, and touch target size.
- Test control actions separately; a correctly arranged button still needs its behavior configured.
Continue with the element catalog, Subpages, and Themes.
Reveal nested elements
Version 27.0.29 adds childAnimate and childAnimateDelay for a container's element entrance cascade. Choose a preset and delay, then test the page in Live Preview; the editor canvas stays static. Element presets override the inherited choice, while an explicit none opts an element out. See Visibility and entrance animations for timing, list-item animations, and reduced-motion behavior.
Scroll snap
Since 27.0.8, a responsive container can snap its scroll resting positions to its direct elements. In Container layout → Scroll, choose a scrollable mode, expand Scroll snap, enable it, and select Start, Center, or End alignment. Snap is off by default; saved keys are scrollSnap and scrollSnapAlign (start, center, end).
Snap does not make content overflow: prepare enough content to scroll, then test several resting positions in Live Preview. A fixed-layout container does not scroll and ignores snap; Disabled scroll hides the snap card. An inner scroller, such as a grid Subpage List, needs its own snap settings and counts as one target in the outer container. Snap has no theme keys.





