Table of Contents

Class MudText

Namespace
MudBlazor
Assembly
MudBlazor.dll

A customizable piece of text.

public class MudText : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
Inheritance
MudText
Implements
Inherited Members
Extension Methods

Constructors

MudText()

public MudText()

Properties

Align

The horizontal alignment of this text.

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

Property Value

Align

Remarks

Defaults to Inherit. Controls which text-align will be used. Has no effect on inline displays.

ChildContent

The child content to display.

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

Property Value

RenderFragment

Classname

protected string Classname { get; }

Property Value

string

Color

The color of this text.

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

Property Value

Color

Remarks

Defaults to Inherit.

GutterBottom

Adds a bottom margin.

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

Property Value

bool

Remarks

Defaults to false. Has no effect on inline displays.

HtmlTag

The HTML element used for this text. that will be rendered (Example: span, p, h1).

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

Property Value

string

Remarks

Defaults to null, meaning the tag is automatically decided based on Typo.
A custom tag such as span, p, h1 can be used to specify the type of content for accessibility and SEO more accurately.
The tag affects the display type and the applicability of properties like Align and GutterBottom.

Inline

Whether this text continues on the same line.

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

Property Value

bool

Remarks

Defaults to false. When false, text will start on a new line.

RightToLeft

Whether text is displayed right-to-left.

[CascadingParameter(Name = "RightToLeft")]
public bool RightToLeft { get; set; }

Property Value

bool

Typo

The theme style of the text.

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

Property Value

Typo

Remarks

Defaults to body1. Uses the theme HTML tag unless HtmlTag is set.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder