RadzenSidebar Class

A collapsible sidebar component for application navigation, typically used within RadzenLayout. RadzenSidebar provides a navigation panel that can be toggled open/closed and responds to screen size changes. Commonly used in application layouts for primary navigation menus. Features responsive design (automatically collapses on mobile devices and expands on desktop, configurable), positioning on Left/Right/Start/End of the layout, full height option to span entire layout height or align with body section only, programmatic expand/collapse via Expanded property or Toggle() method, seamless integration with RadzenLayout/RadzenHeader/RadzenBody/RadzenFooter, and typically contains RadzenPanelMenu or RadzenMenu for navigation. Must be used inside RadzenLayout to enable responsive behavior and proper layout integration. Use @bind-Expanded for two-way binding to control sidebar state from code.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenComponentWithChildren

RadzenSidebar

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenSidebar : RadzenComponentWithChildren, IComponent, IHandleEvent, IHandleAfterRender

Examples

Basic sidebar with menu:

<RadzenLayout>
    <RadzenHeader>...</RadzenHeader>
    <RadzenSidebar @bind-Expanded=@sidebarExpanded>
        <RadzenPanelMenu>
            <RadzenPanelMenuItem Text="Home" Icon="home" Path="/" />
            <RadzenPanelMenuItem Text="Orders" Icon="shopping_cart" Path="/orders" />
        </RadzenPanelMenu>
    </RadzenSidebar>
    <RadzenBody>...</RadzenBody>
</RadzenLayout>

Right-positioned full-height sidebar:

<RadzenSidebar Position="SidebarPosition.Right" FullHeight="true">
    Sidebar content...
</RadzenSidebar>

Constructors

RadzenSidebarlink

A collapsible sidebar component for application navigation, typically used within RadzenLayout. RadzenSidebar provides a navigation panel that can be toggled open/closed and responds to screen size changes. Commonly used in application layouts for primary navigation menus. Features responsive design (automatically collapses on mobile devices and expands on desktop, configurable), positioning on Left/Right/Start/End of the layout, full height option to span entire layout height or align with body section only, programmatic expand/collapse via Expanded property or Toggle() method, seamless integration with RadzenLayout/RadzenHeader/RadzenBody/RadzenFooter, and typically contains RadzenPanelMenu or RadzenMenu for navigation. Must be used inside RadzenLayout to enable responsive behavior and proper layout integration. Use @bind-Expanded for two-way binding to control sidebar state from code.

Declaration
public RadzenSidebar()

Properties

Expandedlink

Gets or sets a value indicating whether this RadzenSidebar is expanded.

Declaration
public bool Expanded { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether this RadzenSidebar is expanded.

ExpandedChangedlink

Gets or sets the expanded changed callback.

Declaration
public EventCallback<bool> ExpandedChanged { get; set; }
Property Value
Type Description
EventCallback<bool>Gets or sets the expanded changed callback.

FullHeightlink

Gets or sets whether the sidebar occupies the full height of the layout (from top to bottom). When false (default), sidebar appears between header and footer, aligned with body section. When true, sidebar stretches the entire layout height alongside all sections.

Declaration
public bool FullHeight { get; set; }
Property Value
Type Description
boolGets or sets whether the sidebar occupies the full height of the layout (from top to bottom). When false (default), sidebar appears between header and footer, aligned with body section. When true, sidebar stretches the entire layout height alongside all sections.

Layoutlink

The RadzenLayout this component is nested in.

Declaration
public RadzenLayout Layout { get; set; }
Property Value
Type Description
RadzenLayoutThe RadzenLayout this component is nested in.

Positionlink

Gets or sets which side of the layout the sidebar appears on. Options include Left, Right, Start (left in LTR, right in RTL), End (right in LTR, left in RTL).

Declaration
public SidebarPosition? Position { get; set; }
Property Value
Type Description
SidebarPosition?Gets or sets which side of the layout the sidebar appears on. Options include Left, Right, Start (left in LTR, right in RTL), End (right in LTR, left in RTL).

Responsivelink

Gets or sets whether the sidebar should automatically collapse on small screens (responsive mode). When true (default), the sidebar expands on desktop and collapses on mobile. When false, responsive behavior is disabled. Responsive mode only works when RadzenSidebar is inside RadzenLayout.

Declaration
public bool Responsive { get; set; }
Property Value
Type Description
boolGets or sets whether the sidebar should automatically collapse on small screens (responsive mode). When true (default), the sidebar expands on desktop and collapses on mobile. When false, responsive behavior is disabled. Responsive mode only works when RadzenSidebar is inside RadzenLayout.

ResponsiveMaxWidthlink

Gets or sets the maximum width, in pixels, at which the component switches to a responsive layout.

Declaration
public string ResponsiveMaxWidth { get; set; }
Property Value
Type Description
stringGets or sets the maximum width, in pixels, at which the component switches to a responsive layout.

Stylelink

Gets or sets custom CSS styles for the sidebar. Default positioning and sizing can be overridden via this property.

Declaration
public string Style { get; set; }
Property Value
Type Description
stringGets or sets custom CSS styles for the sidebar. Default positioning and sizing can be overridden via this property.

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

GetStylelink

Gets the style.

Declaration
protected string GetStyle()
Returns
Type Description
stringSystem.String.

OnInitializedlink

Declaration
protected override void OnInitialized()

SetParametersAsynclink

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task

Togglelink

Programmatically toggles the sidebar between expanded and collapsed states. Call this method to show/hide the sidebar from code, such as from a hamburger menu button click.

Declaration
public void Toggle()
An error has occurred. This app may no longer respond until reloaded. Reload 🗙