Flex
Arrange elements with direction, alignment, spacing, and wrapping.
Usage guide
#Use to align items along one axis, such as button groups or toolbars. Use Layout for the overall page structure.
Main-axis alignment
justify positions items along the axis specified by direction.
Cross-axis alignment
align aligns items on the perpendicular axis. Changing direction changes both axes.
Examples
#Feature examples
#Choose a feature from 10 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-flex>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
FlexAlign | 'start' | Alignment perpendicular to the main axis. | |
FlexGap | 'medium' | Spacing token between rows. | |
FlexGap | 'medium' | Spacing token between columns. | |
FlexJustify | 'start' | Alignment along the main axis. | |
FlexDirection | 'horizontal' | Horizontal, vertical, or reverse layout direction. | |
FlexWrap | 'nowrap' | How items wrap when width or height is insufficient. | |
FlexGap | 'medium' | Spacing token used for padding. | |
string | '' | Width as a CSS length or a numeric string interpreted as pixels. | |
string | '' | Height as a CSS length or a numeric string interpreted as pixels. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |