Table of Contents

Class MudHidden

Namespace
MudBlazor
Assembly
MudBlazor.dll

A component which conditionally renders content depending on the screen size.

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

Remarks

This component uses JavaScript to listen for browser window size changes. If you want a solution using only CSS, you can use the responsive display classes.

Constructors

MudHidden()

public MudHidden()

Properties

Breakpoint

The breakpoint at which component is not rendered, when Invert is false.

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

Property Value

Breakpoint

Remarks

When Invert is true, this property controls when the content is shown.

BrowserViewportService

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

Property Value

IBrowserViewportService

ChildContent

The content within this component.

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

Property Value

RenderFragment

CurrentBreakpointFromProvider

The current breakpoint.

[CascadingParameter]
public Breakpoint CurrentBreakpointFromProvider { get; set; }

Property Value

Breakpoint

Remarks

Defaults to None.

Hidden

Hides the content within this component.

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

Property Value

bool

Remarks

Defaults to true.

HiddenChanged

Occurs when Hidden has changed.

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

Property Value

EventCallback<bool>

Invert

Causes the Breakpoint to control when content is displayed.

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

Property Value

bool

Remarks

Defaults to false.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

DisposeAsync()

Releases resources used by this component.

public ValueTask DisposeAsync()

Returns

ValueTask

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

OnParametersSetAsync()

protected override Task OnParametersSetAsync()

Returns

Task

UpdateAsync(Breakpoint)

protected Task UpdateAsync(Breakpoint currentBreakpoint)

Parameters

currentBreakpoint Breakpoint

Returns

Task