Table of Contents

Class TwFooter

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll

A page footer: columns of titled links, an optional brand area above them, free-form content, and a bottom row for a copyright line and a few legal links. Every part is optional, so it works as a one-line footer or a full site map.

public class TwFooter : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent
Inheritance
TwFooter
Implements
Inherited Members

Remarks

Pass Sections for the common case and the component writes the markup. For anything else, use ChildContent, which is rendered between the sections and the bottom row.

Accessibility: the root is a footer element, which is the page's content information landmark when it is not inside an article, section or main. The sections sit in a nav landmark named by NavigationLabel. Each section is a heading followed by a list that the heading names, so a screen reader announces the group and how many links it holds. Links are ordinary tab stops in reading order with a visible focus ring, and a link that opens in a new tab says so.

Constructors

TwFooter()

public TwFooter()

Properties

BottomContent

Gets or sets extra content for the bottom row, after the copyright line and the bottom links, such as social media links or a language picker.

[Parameter]
public RenderFragment? BottomContent { get; set; }

Property Value

RenderFragment

Gets or sets the links along the bottom row, typically legal pages such as privacy and terms.

[Parameter]
public IReadOnlyList<FooterLink> BottomLinks { get; set; }

Property Value

IReadOnlyList<FooterLink>

BrandContent

Gets or sets content shown above the sections, such as a logo and a short description.

[Parameter]
public RenderFragment? BrandContent { get; set; }

Property Value

RenderFragment

ChildContent

Gets or sets free-form content, rendered after the sections and before the bottom row.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Gets or sets the copyright line shown in the bottom row.

[Parameter]
public string? Copyright { get; set; }

Property Value

string

HeadingLevel

Gets or sets the heading level of the section titles, from 1 to 6.

[Parameter]
public int HeadingLevel { get; set; }

Property Value

int

Remarks

Default is 2. Choose the level that follows on from the headings above the footer on your page.

NavigationLabel

Gets or sets the accessible name of the navigation landmark that holds the sections. Defaults to the localized Footer_Label text ("Footer links").

[Parameter]
public string? NavigationLabel { get; set; }

Property Value

string

Remarks

A page usually has other navigation landmarks, so this name is what tells them apart.

Sections

Gets or sets the titled groups of links, each drawn as a column.

[Parameter]
public IReadOnlyList<FooterSection> Sections { get; set; }

Property Value

IReadOnlyList<FooterSection>

Remarks

Sections without a title or without any links are left out.

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder