Default Light
MgLibrary
Overview
Installation
Buttons
Cards
Charts
Codes
Data Grids
Dropdowns
Editors
Headers & Animations
Icons
Indicators
Inputs
Lists
Modals
Menus
Panels
Pills & Chips
Scheduling
Tabs
Time Line
Trees
Customization

Stack Panels

Flexible layout containers for building rows and columns with predictable spacing and alignment.

Use this example to explore default behavior, customization points, and accessibility-friendly patterns in a real Blazor page.

Stack Panel

MgStackPanel

A flex-based container with typed options for orientation, justification, alignment, wrapping, and spacing.

API Reference

MgStackPanel

Property Type Default Description
Orientation MgOrientation Vertical Sets the stack direction.
JustifyContent MgFlexJustifyContent Default Controls main-axis distribution.
AlignItems MgFlexAlignItems Default Controls cross-axis alignment for items.
AlignContent MgFlexAlignContent Default Controls alignment of wrapped lines.
Gap MgFlexGap Default Controls spacing between children.
Wrap MgFlexWrap Default Controls whether children can wrap onto multiple lines.
Classes string null Additional CSS classes applied to the container.
MgStyle string null Inline style string for the container.
ChildContent RenderFragment null Content rendered inside the flex container.

MgFlexJustifyContent

Value Class Description
Default-No justify class is applied.
Startjustify-startItems are packed toward the start.
Endjustify-endItems are packed toward the end.
Centerjustify-centerItems are centered on the main axis.
Betweenjustify-betweenItems spread with space between them.
Aroundjustify-aroundItems spread with space around them.
Evenlyjustify-evenlyItems spread with equal space everywhere.

MgFlexAlignItems

Value Class Description
Default-No alignment class is applied.
Startitems-startItems align to the start of the cross axis.
Enditems-endItems align to the end of the cross axis.
Centeritems-centerItems align to the center of the cross axis.
Baselineitems-baselineItems align to their typographic baselines.
Stretchitems-stretchItems stretch to fill the cross axis.

MgFlexAlignContent

Value Class Description
Default-No content alignment class is applied.
Startcontent-startWrapped rows cluster at the start.
Endcontent-endWrapped rows cluster at the end.
Centercontent-centerWrapped rows center in the container.
Betweencontent-betweenWrapped rows are spaced between start and end.
Aroundcontent-aroundWrapped rows are spaced around.
Evenlycontent-evenlyWrapped rows are evenly distributed.
Stretchcontent-stretchWrapped rows stretch to fill the container.

MgFlexGap

Value Class Description
Default-No gap class is applied.
Nonegap-0No space between items.
Xsgap-1Extra-small spacing.
Smgap-2Small spacing.
Mdgap-4Medium spacing.
Lggap-6Large spacing.
Xlgap-8Extra-large spacing.
Xxlgap-12Double extra-large spacing.

MgFlexWrap

Value Class Description
Default-No wrap class is applied.
NoWrapflex-nowrapPrevents items from wrapping.
Wrapflex-wrapAllows items to wrap onto the next line.
WrapReverseflex-wrap-reverseWraps items in reverse order.
An unhandled error has occurred. Reload 🗙