You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91Lines changed: 91 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,3 +127,94 @@ Example of usage:
127
127
</Page>
128
128
129
129
```
130
+
131
+
132
+
## FlexPanel
133
+
134
+
**FlexPanel** is a layout panel similar to `StackPanel`, but with additional control over how children are spaced and aligned. It supports a layout model inspired by CSS Flexbox, making it easier to create clean, consistent UIs without extra nesting or manual margin tweaking.
135
+
136
+
#### Key features
137
+
138
+
-**Orientation**
139
+
Arrange children in a `Horizontal` or `Vertical` layout using the `Orientation` property, just like with `StackPanel`.
140
+
141
+
-**Justify**
142
+
Controls how space is distributed along the main axis. Options include:
143
+
-`Start`
144
+
-`Center`
145
+
-`End`
146
+
-`SpaceBetween`
147
+
-`SpaceAround`
148
+
-`SpaceEvenly`
149
+
-`SpaceAuto`
150
+
151
+
-**Align**
152
+
Controls alignment along the cross axis.
153
+
Unlike `StackPanel`, where you typically set `HorizontalAlignment` or `VerticalAlignment` on each child, `FlexPanel` allows you to control all children’s alignment from the panel itself using the `Align` property.
154
+
155
+
-**Simplified layout**
156
+
Ideal for toolbars, button groups, or dashboards where you want consistent spacing and alignment without relying on `Grid` or setting margins manually.
157
+
158
+
#### Things to know
159
+
160
+
-**Child `Margin` is currently ignored**
161
+
Spacing is handled entirely by the panel based on the `Justify` setting. Margins set on individual children will not affect layout.
162
+
163
+
-**Children are arranged using their natural `DesiredSize`**
164
+
There is currently no support for stretching or shrinking children to fill space (no equivalent of `flex-grow` or `flex-shrink`).
165
+
166
+
-**No wrapping support**
167
+
Children are arranged in a single row or column only. If you need wrapping behavior, use a `WrapPanel` instead.
168
+
169
+
-**Simplified alignment options**
170
+
`Align` currently supports only `Start`, `Center`, and `End`. More advanced options like `baseline` or `stretch` are not implemented yet.
171
+
172
+
-**AddHeight property**
173
+
Adds extra vertical space to the layout, useful when additional height is needed beyond what the children require.
174
+
175
+
This panel is useful in scenarios where `StackPanel` is too limited, but using a `Grid` would add unnecessary complexity.
176
+
177
+

0 commit comments