New to Telerik UI for BlazorStart a free 30-day trial

Represents a Telerik UI for Blazor Drawer component that displays a collapsible side navigation panel which provides seamless access to application sections and navigation items. The component enables responsive navigation patterns by offering both expanded and collapsed states, with optional mini mode for icon-only display. Supports flexible positioning (left or right side), interaction modes (overlay or push), and comprehensive customization through templates and styling events.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Type Parameters:

TItem

The type of the data model used for drawer navigation items.

Syntax:

C#
public class TelerikDrawer<TItem> : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikDrawer<TItem>

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)...

Constructors

C#
public TelerikDrawer()

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

Programmatically collapses the drawer to its hidden or mini mode state with smooth animation. When called, the drawer transitions from expanded to collapsed state, triggering the ExpandedChanged event and updating the UI.

C#
public Task CollapseAsync()
Returns:

Task

C#
public override void Dispose()

Overrides: BaseComponent.Dispose()

Programmatically expands the drawer to its full visible state with smooth animation. The method triggers the ExpandedChanged event and automatically handles animation timing for optimal user experience.

C#
public Task ExpandAsync()
Returns:

Task

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

C#
protected override Task OnParametersSetAsync()
Returns:

Task

Overrides: ComponentBase.OnParametersSetAsync()

C#
public override Task SetParametersAsync(ParameterView parameters)
Parameters:parametersParameterViewReturns:

Task

Overrides: ComponentBase.SetParametersAsync(ParameterView)

Toggles the drawer between expanded and collapsed states, providing a convenient single method for state switching.

C#
public Task ToggleAsync()
Returns:

Task

Properties

Provides the collection of items that populate the drawer's navigation list.

C#
[Parameter]
public IEnumerable<TItem> Data { get; set; }

Contains the main application content that appears alongside the drawer in the page layout. The content automatically adjusts its position and size based on the drawer's Mode and Expanded state.

C#
[Parameter]
public RenderFragment DrawerContent { get; set; }

Controls whether the drawer is currently visible (expanded) or hidden (collapsed). Use two-way binding with ExpandedChanged to respond to user interactions that change drawer state. Default value is false.

C#
[Parameter]
public bool Expanded { get; set; }

Fires when the drawer's expanded state changes between visible and hidden.

C#
[Parameter]
public EventCallback<bool> ExpandedChanged { get; set; }

Specifies the property name in your data model that contains the icon identifier for each drawer item. The icon appears next to the item text and is especially important in MiniMode where only icons are visible when collapsed. Default value is "Icon".

C#
[Parameter]
public string IconField { get; set; }

Customizes how individual drawer items are displayed while maintaining the default list structure and behavior. Each item in Data is rendered using this template, providing access to the item's properties for custom display logic.. Ignored when Template is provided, as the full template takes precedence over individual item customization.

C#
[Parameter]
public RenderFragment<TItem> ItemTemplate { get; set; }

Enables a compact view showing only icons when the drawer is collapsed. Default value is false.

C#
[Parameter]
public bool MiniMode { get; set; }

Controls how the drawer interacts with page content when expanding and collapsing. Default value is Overlay.

C#
[Parameter]
public DrawerMode Mode { get; set; }
Remarks:

Push moves page content aside to make room for the drawer, preserving content visibility. Overlay displays the drawer on top of page content with a semi-transparent backdrop.

Fires when each drawer item is being rendered, allowing you to apply custom CSS classes for conditional styling. The event provides DrawerItemRenderEventArgs containing the current item and a Class property for setting custom CSS classes. The custom classes are applied in addition to the default drawer item styling.

C#
[Parameter]
public Action<DrawerItemRenderEventArgs> OnItemRender { get; set; }

Controls which side of the page the drawer appears on when expanded. Default value is Start.

C#
[Parameter]
public DrawerPosition Position { get; set; }
Remarks:

Start displays the drawer on the left side of the screen (default). End displays the drawer on the right side of the screen.

Specifies which item in the drawer is currently selected, typically representing the active page or section. Use two-way binding with SelectedItemChanged to create responsive navigation.

C#
[Parameter]
public TItem SelectedItem { get; set; }

Fires when a user clicks on a drawer item, providing the clicked item for navigation handling. The event provides the clicked item object, which you can use to determine the target page or action.

C#
[Parameter]
public EventCallback<TItem> SelectedItemChanged { get; set; }

Specifies the property name in your data model that indicates whether an item should be rendered as a visual separator. Default value is "Separator".

C#
[Parameter]
public string SeparatorField { get; set; }

Provides complete control over the drawer's content rendering, replacing the default item list with custom markup. Takes precedence over ItemTemplate and renders instead of the default item list when provided. Receives the entire Data collection as context, allowing you to implement custom rendering logic, grouping, or filtering.

C#
[Parameter]
public RenderFragment<IEnumerable<TItem>> Template { get; set; }

Specifies the property name in your data model that contains the display text for each drawer item. This text appears as the primary label for navigation items and should be descriptive and user-friendly. Default value is "Text".

C#
[Parameter]
public string TextField { get; set; }

Specifies the property name in your data model that contains the navigation URL for each drawer item. Default value is "Url".

C#
[Parameter]
public string UrlField { get; set; }

Sets the width of the expanded drawer using any valid CSS unit. Default value is "240px".

C#
[Parameter]
public string Width { get; set; }