Skip to main content

LgMenuTitle

LgMenuTitle displays a section title in the menu. It serves to visually group entries and its display depends on the current menu renderer.

<LgMenuTitle Text="#Administration" />
  • Namespace: Lagoon.UI.Components
  • Inherits from: LgCustomMenuItem → LgAriaComponentBase → LgComponentBase
  • NuGet package: Lagoon.UI
Conditional display

Use LgMenuTitle to structure groups; the component is hidden only when the current renderer activates HideTitleItems, for example in a collapsed sidebar.

Usage​

Group entries in the sidebar​

Place LgMenuTitle before a family of entries to clearly announce the context of the group. The menu renderer can hide titles when HideTitleItems is active.

MenuConfiguration.razor
<LgMenuConfiguration>
<Sidebar>
<LgMenuTitle Text="#Administration" />
<LgMenuItem Text="#Users" IconName="@IconNames.All.PeopleFill" Uri="admin/users" />
<LgMenuItem Text="#Roles" IconName="@IconNames.All.ShieldLockFill" Uri="admin/roles" />

<LgMenuTitle Text="#Monitoring" />
<LgMenuItem Text="#Logs" IconName="@IconNames.All.CardList" Uri="admin/logs" />
</Sidebar>
</LgMenuConfiguration>

Reuse a title in a LgMenuSet​

The title can be part of a reusable group and included in multiple areas. It remains hidden only if the current renderer does not display it.

MenuConfiguration.razor
<LgMenuConfiguration>
<MenuSetDeclarations>
<LgMenuSet Id="support-menu">
<LgMenuTitle Text="#Support" />
<LgMenuItem Text="#Documentation" IconName="@IconNames.Question" Uri="help/documentation" />
<LgMenuItem Text="#ContactSupport" IconName="@IconNames.All.Envelope" Uri="help/contact" />
</LgMenuSet>
</MenuSetDeclarations>

<Sidebar>
<LgIncludeMenuSet Id="support-menu" />
</Sidebar>
</LgMenuConfiguration>

Properties​

NameTypeDefaultDeclared inDescription
TextstringnullLgMenuTitleSection title displayed in the menu.
AriaLabelstringnullLgAriaComponentBaseValue of the aria-label attribute.
AriaLabelledBystringnullLgAriaComponentBaseValue of the aria-labelledby attribute.

Accessibility​

  • Use short and explicit text to clearly announce the following group of actions.
  • Maintain a logical order of titles in the sidebar to facilitate navigation.