Stack layout
Stack layout
StackLayout
displays items in horizontal or vertical order on a single line. It builds on the FlexLayout
component and is best for small-scale layouts where displaying components in a single row or column is necessary. It may benefit from supported visual separators, such as a row of charts or a scrolling side panel comprising multiple sections. For additional control of the size and position of content, use FlexItem
for each content item inside StackLayout
.
Examples
How to use
Accessibility
- When you need a layout that's consistently horizontal or vertical. If there isn't enough space in the main axis, scrolling the content is acceptable.
- For small-scale layouts within the application, such as a stack of cards or charts or a vertical side panel with visually distinct sections.
- To change the layout’s direction depending on breakpoints or add visual separation using the stack layout separators.
- Stack layouts will never wrap. If you want to create a layout in a row that responsively wraps over multiple lines, use
FlowLayout
instead. - If you want the layout to have more complex customization. In this case, consider
FlexLayout
.
To import StackLayout
from the core Salt package, use:
Name | Type | Description | Default |
---|