# RadzenText Class

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.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md)
- RadzenText

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender

## Syntax

```csharp
public class RadzenText : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender
```

## Examples

Heading text:

```razor
<RadzenText TextStyle="TextStyle.H3">Welcome to Our Application</RadzenText>
```

Subtitle with alignment:

```razor
<RadzenText TextStyle="TextStyle.Subtitle1" TextAlign="TextAlign.Center">
    This is a centered subtitle
</RadzenText>
```

Body text with custom tag:

```razor
<RadzenText TextStyle="TextStyle.Body1" TagName="TagName.Div">
    This is body text rendered as a div element.
</RadzenText>
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public 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. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| Anchor | `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. |
| AnchorAriaLabel | `string` | Gets or sets the visually hidden text of the anchor link rendered when Anchor is set. Provides an accessible name for the anchor link. Localizable via the Text_AnchorAriaLabel resource key. |
| ChildContent | `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. |
| TagName | [`TagName`](https://blazor.radzen.com/docs/api/Radzen.Blazor.TagName.md) | 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. |
| Text | `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. |
| TextAlign | [`TextAlign`](https://blazor.radzen.com/docs/api/Radzen.TextAlign.md) | Gets or sets the horizontal text alignment within the container. Options include Left, Right, Center, Justify, Start, End, and JustifyAll. |
| TextStyle | [`TextStyle`](https://blazor.radzen.com/docs/api/Radzen.Blazor.TextStyle.md) | 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. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `BuildRenderTree(Rendering.RenderTreeBuilder builder)` | `void` |  |

## Inherited Members

- From [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md): AddContextMenu, Attributes, ContextMenu, Culture, CurrentStyle, Debounce, DefaultCulture, DefaultUICulture, Dispose, Element, GetComponentCssClass, GetCssClass, GetId, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnAfterRenderAsync, OnBecameInvisible, OnContextMenu, OnInitialized, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, SetParametersAsync, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

