Layout
TwBreadcrumb
TwBreadcrumb is a Blazor breadcrumb component that shows the current page location. Build trails automatically with Auto, or manually with Label, Href and Icon.
Last updated
Custom separators
The separator between breadcrumbs is a
/ by default. Set Separator to use any other text, such as a dot:RAZOR
<TwBreadcrumb Separator="•">
<TwBreadcrumbItem Label="Home" Href="/" />
<TwBreadcrumbItem Label="Docs" Href="/" />
<TwBreadcrumbItem Label="Breadcrumb" Href="/breadcrumb" AriaCurrent />
</TwBreadcrumb>Set SeparatorIcon to use an icon instead, such as a chevron or an arrow. It works with Breadcrumbs and Auto as well as inline items:
RAZOR
<TwBreadcrumb SeparatorIcon="Icon.Chevron_Right">
<TwBreadcrumbItem Label="Home" Href="/" Icon="Icon.House" />
<TwBreadcrumbItem Label="Docs" Href="/" />
<TwBreadcrumbItem Label="Breadcrumb" Href="/breadcrumb" AriaCurrent />
</TwBreadcrumb>RAZOR
<TwBreadcrumb Breadcrumbs="@_breadcrumbs" SeparatorIcon="Icon.Arrow_Right" />A TwBreadcrumbItem can set its own Separator or SeparatorIcon, which is shown before that item only. Separators are decorative, so they are hidden from screen readers, which already announce the trail as a list.
RAZOR
<TwBreadcrumb Separator="•">
<TwBreadcrumbItem Label="Home" Href="/" />
<TwBreadcrumbItem Label="Docs" Href="/" />
<TwBreadcrumbItem Label="Breadcrumb" Href="/breadcrumb" SeparatorIcon="Icon.Arrow_Right" AriaCurrent />
</TwBreadcrumb>Theme configuration
Styling is controlled by
TwBlazorTheme.Components (a TwBreadcrumbTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
| Property | Type | Controls |
|---|---|---|
List |
string | |
Item |
string | |
Separator |
string | |
SeparatorIcon |
string | |
Label |
string | |
Link |
string | |
Current |
string | |
Icon |
string | |
CurrentIcon |
string |
Full reference: TwBreadcrumbTheme on the API docs.