Skip to main content

LgTitle

LgTitle displays a section title rendered as an <h1> to <h6> tag based on the level chosen. The text goes through the translation dictionary (keys #MyKey).

<LgTitle Text="#OrdersSection" TitleLevel="TitleLevel.Level2" />
  • Namespace : Lagoon.UI.Components
  • Inherits from : LgAriaComponentBase → LgComponentBase
  • NuGet package : Lagoon.UI

Usage​

Demo​

Try this component in the Lagoon showcase.

Title level​

The level is defined by TitleLevel (enumeration) or by Level (integer 1 to 6; both parameters control the same value, out-of-bounds values are clamped to 1-6).

DashboardPage.razor
<LgTitle Text="#Dashboard" TitleLevel="TitleLevel.Level1" />

<LgTitle Text="#RecentOrders" Level="2" CssClass="mt-4" />

Properties​

All [Parameter] properties of the component, including inherited ones.

NameTypeDefaultDeclared inDescription
CssClassstringnullLgTitleAdditional CSS classes.
Levelint0LgTitleTitle level (1 to 6); out-of-bounds values are clamped to 1-6.
TextstringnullLgTitleTitle text (plain text or dictionary key #MyKey).
TitleLevelTitleLevel(TitleLevel)0LgTitleTitle level as an enumeration; controls the same value as Level.
AriaLabelstringnullLgAriaComponentBaseValue of the aria-label attribute.
AriaLabelledBystringnullLgAriaComponentBaseValue of the aria-labelledby attribute.

Associated enumerations​

TitleLevel​

ValueDescription
Level1Renders an <h1>.
Level2Renders an <h2>.
Level3Renders an <h3>.
Level4Renders an <h4>.
Level5Renders an <h5>.
Level6Renders an <h6>.

Best practices / accessibility​

  • Respect the heading level hierarchy in the page (one h1 only, no level skipping): it structures navigation for screen readers.
  • Choose the level for structure, not size: adjust appearance with CssClass if needed.
Complete reference

All parameters: API Reference — LgTitle.