Table of Contents

Class MudComponentBase

Namespace
MudBlazor
Assembly
MudBlazor.dll

Represents a base class for designing MudBlazor components.

public abstract class MudComponentBase : ComponentBaseWithState, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
Inheritance
MudComponentBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

MudComponentBase()

protected MudComponentBase()

Properties

Class

The CSS classes applied to this component.

[Parameter]
[Category("Common")]
public string? Class { get; set; }

Property Value

string

Remarks

Defaults to null. You can use spaces to separate multiple classes. Use the Style property to apply custom CSS styles.

FieldId

If the UserAttributes contain an ID make it accessible for WCAG labelling of input fields

public string FieldId { get; }

Property Value

string

IsJSRuntimeAvailable

Whether the JSRuntime is available.

protected bool IsJSRuntimeAvailable { get; set; }

Property Value

bool

Remarks

When true, JavaScript interop calls can be made.

Logger

protected ILogger Logger { get; }

Property Value

ILogger

Style

The CSS styles applied to this component.

[Parameter]
[Category("Common")]
public string? Style { get; set; }

Property Value

string

Remarks

Defaults to null. Use the Class property to apply CSS classes.

Tag

The arbitrary object to link to this component.

[Parameter]
[Category("Common")]
public object? Tag { get; set; }

Property Value

object

Remarks

This property is typically used to associate additional information with this component, such as a model containing data for this component.

UserAttributes

The additional HTML attributes to apply to this component.

[Parameter(CaptureUnmatchedValues = true)]
[Category("Common")]
public Dictionary<string, object?> UserAttributes { get; set; }

Property Value

Dictionary<string, object>

Remarks

This property is typically used to provide additional HTML attributes during rendering such as ARIA accessibility tags or a custom ID.

Methods

OnAfterRender(bool)

protected override void OnAfterRender(bool firstRender)

Parameters

firstRender bool