Table of Contents

Class MudListItem<T>

Namespace
MudBlazor
Assembly
MudBlazor.dll
public class MudListItem<T> : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IDisposable

Type Parameters

T
Inheritance
MudListItem<T>
Implements
Inherited Members
Extension Methods

Constructors

MudListItem()

public MudListItem()

Properties

AvatarContent

Add an Avatar or custom icon content here. When this is set, Icon will be ignored

[Parameter]
[Category("Appearance")]
public RenderFragment? AvatarContent { get; set; }

Property Value

RenderFragment

ChildContent

Display content of this list item. If set, this overrides Text

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

Property Value

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

Dense

If true, compact vertical padding will be used.

[Parameter]
[Category("Appearance")]
public bool? Dense { get; set; }

Property Value

bool?

Disabled

If true, will disable the list item if it has OnClick. The value can be overridden by the parent list.

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

Property Value

bool

ExpandIconColor

The color of the ExpandLessIcon and ExpandMoreIcon. It supports the theme colors.

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

Property Value

Color

ExpandLessIcon

Custom expand less icon.

[Parameter]
[Category("Expanding")]
public string ExpandLessIcon { get; set; }

Property Value

string

ExpandMoreIcon

Custom expand more icon.

[Parameter]
[Category("Expanding")]
public string ExpandMoreIcon { get; set; }

Property Value

string

Expanded

Expand or collapse nested list. Two-way bindable. Note: if you directly set this to true or false (instead of using two-way binding) it will initialize the nested list's expansion state.

[Parameter]
[Category("Expanding")]
public bool Expanded { get; set; }

Property Value

bool

ExpandedChanged

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

Property Value

EventCallback<bool>

ForceLoad

If true in combination with Href, bypasses client-side routing and forces the browser to load the new page from the server, whether or not the URI would normally be handled by the client-side router. NavigateTo(string, bool, bool)

[Parameter]
[Category("Click action")]
public bool ForceLoad { get; set; }

Property Value

bool

Gutters

If true, left and right padding is added. Default is true

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

Property Value

bool

Href

Link to a URL when clicked.

[Parameter]
[Category("Click action")]
public string? Href { get; set; }

Property Value

string

Icon

Icon to use if set.

[Parameter]
[Category("Behavior")]
public string? Icon { get; set; }

Property Value

string

IconColor

The color of the icon.

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

Property Value

Color

IconSize

Sets the Icon Size.

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

Property Value

Size

Inset

If true, the List Sub-header will be indented.

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

Property Value

bool

MudList

[CascadingParameter]
protected MudList<T>? MudList { get; set; }

Property Value

MudList<T>

NestedList

Add child list items here to create a nested list.

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

Property Value

RenderFragment

OnClick

List click event. Also called when Href is set

[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

OnClickPreventDefault

If set, clicking the list item will only execute the OnClick handler and prevent all other functionality such as following Href or selection.

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

Property Value

bool

Ripple

Gets or sets whether to show a ripple effect when the user clicks the button. Default is true.

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

Property Value

bool

SecondaryText

The secondary text to display

[Parameter]
[Category("Behavior")]
public string? SecondaryText { get; set; }

Property Value

string

Target

The target attribute specifies where to open the link, if Href is specified. Possible values: _blank | _self | _parent | _top | framename

[Parameter]
[Category("Click action")]
public string? Target { get; set; }

Property Value

string

Text

The text to display

[Parameter]
[Category("Behavior")]
public string? Text { get; set; }

Property Value

string

UriHelper

[Inject]
protected NavigationManager UriHelper { get; set; }

Property Value

NavigationManager

Value

[Parameter]
[Category("Selecting")]
public T? Value { get; set; }

Property Value

T

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Dispose()

public void Dispose()

OnClickHandlerAsync(MouseEventArgs)

protected Task OnClickHandlerAsync(MouseEventArgs eventArgs)

Parameters

eventArgs MouseEventArgs

Returns

Task

OnInitializedAsync()

protected override Task OnInitializedAsync()

Returns

Task