RadzenStack Class

A flexbox container component that arranges child elements in a vertical or horizontal stack with configurable spacing and alignment. RadzenStack provides a simpler alternative to RadzenRow/RadzenColumn for linear layouts without the 12-column grid constraint. Ideal for creating simple vertical or horizontal layouts without needing a grid system. Unlike RadzenRow/RadzenColumn which uses a 12-column grid, Stack arranges children linearly with equal spacing. Features Vertical (column) or Horizontal (row) orientation, consistent gap spacing between child elements, AlignItems for cross-axis alignment and JustifyContent for main-axis distribution, option to reverse the order of children, and control whether children wrap to new lines or stay in a single line. Use for simpler layouts like button groups, form field stacks, or toolbar arrangements.

Inheritance

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenStack : RadzenFlexComponent, IComponent, IHandleEvent, IHandleAfterRender

Examples

Vertical stack with gap spacing:

<RadzenStack Gap="1rem">
    <RadzenText>First item</RadzenText>
    <RadzenText>Second item</RadzenText>
    <RadzenText>Third item</RadzenText>
</RadzenStack>

Horizontal button group:

<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" JustifyContent="JustifyContent.End">
    <RadzenButton Text="Cancel" />
    <RadzenButton Text="Save" ButtonStyle="ButtonStyle.Primary" />
</RadzenStack>

Centered content with wrapping:

<RadzenStack Orientation="Orientation.Horizontal" Wrap="FlexWrap.Wrap" AlignItems="AlignItems.Center" Gap="2rem">
    @* Child elements *@
</RadzenStack>

Constructors

RadzenStacklink

A flexbox container component that arranges child elements in a vertical or horizontal stack with configurable spacing and alignment. RadzenStack provides a simpler alternative to RadzenRow/RadzenColumn for linear layouts without the 12-column grid constraint. Ideal for creating simple vertical or horizontal layouts without needing a grid system. Unlike RadzenRow/RadzenColumn which uses a 12-column grid, Stack arranges children linearly with equal spacing. Features Vertical (column) or Horizontal (row) orientation, consistent gap spacing between child elements, AlignItems for cross-axis alignment and JustifyContent for main-axis distribution, option to reverse the order of children, and control whether children wrap to new lines or stay in a single line. Use for simpler layouts like button groups, form field stacks, or toolbar arrangements.

Declaration
public RadzenStack()

Properties

Gaplink

Gets or sets the spacing between child elements in the stack. Accepts CSS length values (e.g., "1rem", "16px", "2em") or unitless numbers (interpreted as pixels). The gap applies uniformly between all adjacent children.

Declaration
public string Gap { get; set; }
Property Value
Type Description
stringGets or sets the spacing between child elements in the stack. Accepts CSS length values (e.g., "1rem", "16px", "2em") or unitless numbers (interpreted as pixels). The gap applies uniformly between all adjacent children.

Orientationlink

Gets or sets the stack direction: Vertical arranges children top-to-bottom, Horizontal arranges left-to-right. This determines the main axis direction for the flexbox layout.

Declaration
public Orientation Orientation { get; set; }
Property Value
Type Description
OrientationGets or sets the stack direction: Vertical arranges children top-to-bottom, Horizontal arranges left-to-right. This determines the main axis direction for the flexbox layout.

Reverselink

Gets or sets whether to reverse the display order of child elements. When true, children are displayed in reverse order (bottom-to-top for vertical, right-to-left for horizontal). Useful for visual reordering without changing markup order.

Declaration
public bool Reverse { get; set; }
Property Value
Type Description
boolGets or sets whether to reverse the display order of child elements. When true, children are displayed in reverse order (bottom-to-top for vertical, right-to-left for horizontal). Useful for visual reordering without changing markup order.

Wraplink

Gets or sets the flex wrap behavior controlling whether child elements wrap to new lines when they don't fit. NoWrap keeps all children on one line (may cause overflow), Wrap allows wrapping to multiple lines.

Declaration
public FlexWrap Wrap { get; set; }
Property Value
Type Description
FlexWrapGets or sets the flex wrap behavior controlling whether child elements wrap to new lines when they don't fit. NoWrap keeps all children on one line (may cause overflow), Wrap allows wrapping to multiple lines.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetComponentStylelink

Gets the component CSS style.

Declaration
protected string GetComponentStyle()
Returns
Type Description
string

GetStylelink

Gets the final CSS style rendered by the component. Combines it with a style custom attribute.

Declaration
protected string GetStyle()
Returns
Type Description
string
An error has occurred. This app may no longer respond until reloaded. Reload 🗙