Table of Contents

Class MudDrawer

Namespace
MudBlazor
Assembly
MudBlazor.dll

Represents a navigation panel docked to the side of the page.

public class MudDrawer : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, INavigationEventReceiver, IBrowserViewportObserver, IAsyncDisposable
Inheritance
MudDrawer
Implements
Inherited Members
Extension Methods

Constructors

MudDrawer()

Creates a new instance.

public MudDrawer()

Properties

Anchor

The edge of the container that the drawer will appear.

[Parameter]
[Category("Behavior")]
public Anchor Anchor { get; set; }

Property Value

Anchor

Remarks

Defaults to Start.

Breakpoint

The browser width at which responsive drawers are hidden.

[Parameter]
[Category("Behavior")]
public Breakpoint Breakpoint { get; set; }

Property Value

Breakpoint

Remarks

Defaults to Md. Supported breakpoints are:

Other breakpoint combinations are aliased as follows:

Setting the value to None will always close the drawer, while Always will always keep it open.

Applies when Variant is set to Responsive or Mini.

BrowserViewportService

[Inject]
protected IBrowserViewportService BrowserViewportService { get; set; }

Property Value

IBrowserViewportService

ChildContent

The content within this drawer.

[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

ClipMode

The position of this drawer when opened, relative to a MudAppBar when inside a MudLayout.

[Parameter]
[Category("Behavior")]
public DrawerClipMode ClipMode { get; set; }

Property Value

DrawerClipMode

Color

The color of the drawer.

[Parameter]
[Category("Appearance")]
public Color Color { get; set; }

Property Value

Color

Remarks

Defaults to Default.

Elevation

The size of the drop shadow.

[Parameter]
[Category("Appearance")]
public int Elevation { get; set; }

Property Value

int

Remarks

Defaults to 1. A higher number creates a heavier drop shadow. Use a value of 0 for no shadow.

Fixed

Shows the drawer in the same position even if the page is scrolled.

[Parameter]
[Category("Behavior")]
public bool Fixed { get; set; }

Property Value

bool

Remarks

Defaults to true.

Height

The height of this drawer.

[Parameter]
[Category("Appearance")]
public string? Height { get; set; }

Property Value

string

Remarks

Defaults to null. Values such as 300px and 30% are supported. Applies to drawers achored to the top or bottom.

MiniWidth

For mini drawers, the width of this drawer.

[Parameter]
[Category("Appearance")]
public string? MiniWidth { get; set; }

Property Value

string

Remarks

Defaults to null. Values such as 300px and 30% are supported. Applies to Mini drawers achored to the left or right.

Open

Displays this drawer.

[Parameter]
[Category("Behavior")]
public bool Open { get; set; }

Property Value

bool

Remarks

Defaults to false. Raises the OpenChanged event upon change. When bound via @bind-Open, this property is updated when this drawer closes itself.

OpenChanged

Occurs when the Open value has changed.

[Parameter]
public EventCallback<bool> OpenChanged { get; set; }

Property Value

EventCallback<bool>

OpenMiniOnHover

For mini drawers, opens this drawer when the pointer hovers over it.

[Parameter]
[Category("Behavior")]
public bool OpenMiniOnHover { get; set; }

Property Value

bool

Remarks

Defaults to false. Applies when Variant is set to Mini.

Overlay

For responsive and temporary drawers, darkens the screen with an overlay when displaying this drawer.

[Parameter]
[Category("Behavior")]
public bool Overlay { get; set; }

Property Value

bool

Remarks

Defaults to true. Applies when Variant is Responsive or Temporary.

OverlayAutoClose

Sets a value indicating whether the overlay should automatically close when clicked.

[Parameter]
[Category("Behavior")]
public bool OverlayAutoClose { get; set; }

Property Value

bool

Remarks

If the Variant is set to Temporary, an overlay will be displayed. When this property is true, clicking on the overlay will close it automatically. When this property is false, the overlay will not close automatically. Defaults to true.

OverlayClass

protected string OverlayClass { get; }

Property Value

string

Stylename

protected string Stylename { get; }

Property Value

string

Variant

The display variant of this drawer.

[Parameter]
[Category("Behavior")]
public DrawerVariant Variant { get; set; }

Property Value

DrawerVariant

Remarks

Defaults to Responsive.

Width

For non-fixed or temporary drawers, the width of this drawer.

[Parameter]
[Category("Appearance")]
public string? Width { get; set; }

Property Value

string

Remarks

Defaults to null. Values such as 300px and 30% are supported. Applies to non-fixed or Temporary drawers anchored to the left or right.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

OnInitialized()

protected override void OnInitialized()

See Also