A text display component with predefined typography styles matching Material Design text hierarchy. RadzenText provides consistent text formatting for headings, subtitles, body text, captions, and more with semantic HTML tags. Simplifies typography by providing preset styles that match your theme's design system, allowing consistent, professionally designed text formatting without managing CSS classes manually. Supports text styles (Display headings H1-H6, subtitles, body text, captions, button text, overlines), automatically uses appropriate HTML tags (h1-h6, p, span) based on style, manual HTML tag specification via TagName property, built-in text alignment (left, right, center, justify), and optional anchor links for heading navigation. TextStyle.DisplayH1-H6 provide large display headings, TextStyle.H1-H6 provide standard headings, Subtitle1/2 for subtitles, Body1/2 for paragraphs, Caption for small text, and Overline for labels.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.GetComponentCssClass
RadzenComponent.SetParametersAsync
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenText : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRenderHeading text:
<RadzenText TextStyle="TextStyle.H3">Welcome to Our Application</RadzenText>
Subtitle with alignment:
<RadzenText TextStyle="TextStyle.Subtitle1" TextAlign="TextAlign.Center">
This is a centered subtitle
</RadzenText>
Body text with custom tag:
<RadzenText TextStyle="TextStyle.Body1" TagName="TagName.Div">
This is body text rendered as a div element.
</RadzenText>A text display component with predefined typography styles matching Material Design text hierarchy. RadzenText provides consistent text formatting for headings, subtitles, body text, captions, and more with semantic HTML tags. Simplifies typography by providing preset styles that match your theme's design system, allowing consistent, professionally designed text formatting without managing CSS classes manually. Supports text styles (Display headings H1-H6, subtitles, body text, captions, button text, overlines), automatically uses appropriate HTML tags (h1-h6, p, span) based on style, manual HTML tag specification via TagName property, built-in text alignment (left, right, center, justify), and optional anchor links for heading navigation. TextStyle.DisplayH1-H6 provide large display headings, TextStyle.H1-H6 provide standard headings, Subtitle1/2 for subtitles, Body1/2 for paragraphs, Caption for small text, and Overline for labels.
public RadzenText()Gets or sets an anchor identifier for creating linkable headings. When set, adds a clickable link icon next to the text that scrolls to this element when clicked. The anchor href will be the current page URL with #anchorname appended.
public string Anchor { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets an anchor identifier for creating linkable headings. When set, adds a clickable link icon next to the text that scrolls to this element when clicked. The anchor href will be the current page URL with #anchorname appended. |
Gets or sets the child content (markup) to display. Use this for rich content with HTML or other Blazor components. Overridden by Text if both are set.
public RenderFragment ChildContent { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the child content (markup) to display. Use this for rich content with HTML or other Blazor components. Overridden by Text if both are set. |
Gets or sets the HTML element tag to render. When set to Auto (default), the tag is chosen automatically based on TextStyle (e.g., H1 style uses <h1> tag). Override to use a specific tag regardless of style.
public TagName TagName { get; set; }
| Type | Description |
|---|---|
| TagName | Gets or sets the HTML element tag to render. When set to Auto (default), the tag is chosen automatically based on TextStyle (e.g., H1 style uses <h1> tag). Override to use a specific tag regardless of style. |
Gets or sets the plain text content to display. For simple text display, use this property. For rich content with markup, use ChildContent instead. When set, takes precedence over ChildContent.
public string Text { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the plain text content to display. For simple text display, use this property. For rich content with markup, use ChildContent instead. When set, takes precedence over ChildContent. |
Gets or sets the horizontal text alignment within the container. Options include Left, Right, Center, Justify, Start, End, and JustifyAll.
public TextAlign TextAlign { get; set; }
| Type | Description |
|---|---|
| TextAlign | Gets or sets the horizontal text alignment within the container. Options include Left, Right, Center, Justify, Start, End, and JustifyAll. |
Gets or sets the typography style that determines the text size, weight, and appearance. Options include display headings (DisplayH1-H6), standard headings (H1-H6), subtitles, body text, captions, and more. Each style provides consistent formatting matching the theme's design system.
public TextStyle TextStyle { get; set; }
| Type | Description |
|---|---|
| TextStyle | Gets or sets the typography style that determines the text size, weight, and appearance. Options include display headings (DisplayH1-H6), standard headings (H1-H6), subtitles, body text, captions, and more. Each style provides consistent formatting matching the theme's design system. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | builder |