Skip to content

Layouts

Footer

Bit.BlazorUI

The BitFooter component renders a bar at the bottom of a site or an application, holding whatever content belongs there: a copyright line, legal links, social icons or a toolbar of actions. It renders a semantic footer element - the contentinfo landmark of the page - and lays its content out in a horizontal line whose color, variant, size, alignment, wrapping, gutters and spacing are all parameters. It can stay in the flow or be pinned to the bottom of the viewport, revealing itself only while the page is scrolled up, or sliding out of the way on demand.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

The footer renders its content in a bar that is as tall as that content plus the paddings of its size. The Height parameter pins it to an exact height in pixels instead.

I'm a Footer

I'm a Footer with a fixed 80px height

I'm a disabled Footer

Variant

The variant decides how the color of the footer is painted: Fill (the default) uses it as the background, Outline keeps the background transparent and draws a border in it, and Text keeps the background transparent with no border, which lets the page show through the footer.

Fill

Outline

Text

Alignment

The content of the footer is a horizontal flex line, and Alignment decides how the free space of that line is shared. SpaceBetween is the classic website footer: a copyright note on one edge and the links on the other. Baseline and Stretch distribute nothing, so those two align the content on the cross axis instead of the horizontal one.

Start
of
the line

Center
of
the line

End
of
the line

Space
between
the items

Space
around
the items

Space
evenly
around the items


VerticalAlign is the other axis: it decides where the content sits in the height of a footer that is taller than its content, which is what a footer with an explicit Height or a stretched neighbour needs. It is centered by default, and the three space distributions have no meaning here.

Top of the footer

Middle of the footer

Bottom of the footer

Wrap

The content of the footer is a single line by default, which squeezes every item once there is not enough room for all of them. Wrap lets it break onto more lines instead, so a footer that holds a credit line, a set of legal links and a row of icons stays readable on a narrow screen. The lines are separated by the row part of Gap and packed by VerticalAlign.

No wrap 1
No wrap 2
No wrap 3
No wrap 4
No wrap 5
No wrap 6
No wrap 7
No wrap 8

Wrapped 1
Wrapped 2
Wrapped 3
Wrapped 4
Wrapped 5
Wrapped 6
Wrapped 7
Wrapped 8

Border & elevation

Bordered draws a divider on the top edge of the footer, and Elevated casts a shadow upwards. Both separate the footer from the content above it, which matters most when the footer is pinned over that content: a border is the flatter, quieter option and the shadow reads as the footer floating above the page.

Bordered


Elevated


Bordered & Elevated

Gutter

The content of the footer sits in a container with paddings around it (the gutter). NoGutter removes them, so the content can run edge to edge - for a full width progress bar, a toolbar of buttons or any content bringing its own spacing.

With the default gutter

Gap

The children of the footer sit right next to each other by default. Gap puts space between them, and it takes any CSS length (or the two value form of the gap shorthand) - so the same footer works for a tight row of icon buttons and for a widely spaced set of legal links.

No
gap
at all

A
0.5rem
gap

A
2rem
gap

Position

Sticky keeps the footer in the flow but pins it to the bottom of the scrolling area until its own place in the content is reached, so it never covers anything. Fixed takes it out of the flow and anchors it to the bottom of the page, which does overlap the content: reserve room for it at the end of the page. Absolute is that same overlap scoped to a box - the footer of a card, a panel or a dialog - and it needs an ancestor with a position of its own to pin itself to. Only one position can win, and Fixed beats Absolute, which beats Sticky.

The two that really sit at the bottom of the screen, Fixed and Sticky, also add the bottom safe area inset of the device, so the footer never lands under a home indicator - and an explicit Height grows by that inset instead of losing part of itself to it.

Sticky (scroll inside the box):

Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
Row 7
Row 8
Row 9
Row 10
Row 11
Row 12
I'm a sticky Footer


Fixed (scoped to the box below for the sake of the demo):

The fixed footer covers the bottom of its page.
I'm a fixed Footer


Absolute (pinned to the bottom of the box that holds it, with no scoping trick needed):

The absolute footer covers the bottom of its container.
I'm an absolute Footer

Reveal

Reveal hides a pinned footer while the scroll goes down and slides it back in as soon as the scroll goes up, so it gives the content the whole viewport while the user is reading and returns the moment they look for it. It is always revealed at the very top and at the very end of the scrolling area, and it needs Fixed or Sticky to have anything to slide over. The OnRevealChanged callback reports every flip of that state, and the read-only IsRevealed member holds it. A footer that hides itself never strands a keyboard user either: it comes back as soon as anything inside it takes the focus.

Scroll inside the box to hide and reveal the footer: revealed

Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
Row 7
Row 8
Row 9
Row 10
Row 11
Row 12
I hide myself while you scroll down


RevealOffset holds the footer in place until the scroll has travelled that many pixels from the top, which keeps it from flickering away on a scroll that has barely started:

Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
Row 7
Row 8
Row 9
Row 10
Row 11
Row 12
I stay until you scroll past 100px

Hidden

Hidden is the programmatic counterpart of Reveal: the footer slides away because the application says so rather than because the page is being scrolled, which is what a contextual bar belonging to only part of a workflow needs. Unlike Visibility, which switches the footer off at once, it animates in and out and keeps the room the footer occupies. A hidden footer is also marked inert, so none of its buttons can be clicked or reached with the keyboard while it is out of the view.

2 items selected

Translucent

Translucent softens the background of the footer and blurs what passes behind it, so a pinned footer hints at the content it covers instead of cutting it off - the frosted glass of a native mobile bar. Only the Fill variant has a background to soften.

Content behind the footer - row 1
Content behind the footer - row 2
Content behind the footer - row 3
Content behind the footer - row 4
Content behind the footer - row 5
Content behind the footer - row 6
I'm a translucent Footer

Accessibility

The footer renders a semantic footer element, which the browser exposes as the contentinfo landmark of the page - the region screen reader users jump to for the copyright, the legal links and the rest of the information about the page. That mapping only holds while the element is not nested in an article, aside, main, nav or section, so a page level footer belongs outside of them.

A page is meant to expose that landmark once, so a second footer (a toolbar of actions, a bar that belongs to one pane) needs an AriaLabel to tell the two apart when they are listed. There is no need to spell out the word footer in that label - the role is announced already.

Usage

A complete site footer: a centered credit line over a row of social links, all of it plain content handed to the footer.

Color

The general colors of the theme are all available, and each of them works with every variant. Without a color the footer keeps the primary background and foreground of the theme, which is what a page level footer usually wants.

Primary

Secondary

Tertiary

Info

Success

Warning

SevereWarning

Error


PrimaryBackground

SecondaryBackground

TertiaryBackground


PrimaryForeground

SecondaryForeground

TertiaryForeground


PrimaryBorder

SecondaryBorder

TertiaryBorder

Size

The size sets the paddings around the content, which is what makes a footer compact or roomy when its height is left to the content.

Small

Medium

Large

Style & Class

Style and Class reach the root element of the footer, while Styles and Classes reach each of its parts by name - the root and the container that holds the content.


Component's Style & Class:

Styled Footer

Classed Footer


Styles & Classes:

Styles

Classes

RTL

Use the Dir parameter to change the direction of the footer, which flips the alignment of its content and the side its paddings sit on.

یک
دو
سه

API

Every parameter, public member, sub-class and enum this component exposes.

BitFooter parameters

Name Type Default value Description
Absolute bool false Renders the footer with an absolute position at the bottom of its nearest positioned ancestor. Fixed takes precedence over it, and it takes precedence over Sticky.
Alignment BitAlignment? null Gets or sets the horizontal distribution of the content of the BitFooter (the CSS justify-content of the container). Baseline and Stretch act on the cross axis (the vertical alignment) instead.
Bordered bool false Renders a divider line on the top edge of the BitFooter to separate it from the content above.
ChildContent RenderFragment? null Gets or sets the content to be rendered inside the BitFooter.
Classes BitFooterClassStyles? null Custom CSS classes for different parts of the BitFooter.
Color BitColor? null The general color of the BitFooter. It is applied through the Variant: as the background color in the Fill variant, and as the text and border color in the Outline and Text variants.
Elevated bool false Renders the BitFooter with a shadow cast upwards, to lift it above the content it overlaps.
Fixed bool false Renders the footer with a fixed position at the bottom of the page. It takes precedence over Absolute and Sticky when more than one of them is set.
Gap string? null Gets or sets the space between the children of the BitFooter (the CSS gap of the container). It takes any CSS length or the two value form of the gap shorthand.
Height int? null Gets or sets the height of the BitFooter (in pixels). The height includes the paddings and the border of the footer, and a Fixed or Sticky footer adds the bottom safe area inset of the device on top of it.
Hidden bool false Slides the BitFooter out of the view, and brings it back when it is turned off again. A hidden footer is also marked inert, so nothing inside it can be clicked or reached with the keyboard while it is out of the view.
NoGutter bool false Removes the default paddings around the content of the BitFooter, so it can span the full width of the footer.
OnRevealChanged EventCallback<bool> Callback for when the reveal state of the footer changes. The provided value is true when the footer is revealed. Only invoked while Reveal is enabled.
Reveal bool false Slides the footer out of the view while the page is scrolled down and brings it back while the page is scrolled up. It only has an effect on a Fixed or Sticky footer, since the others have nothing to slide over.
RevealOffset int? null Gets or sets how far (in pixels) the scroll has to travel from the top before a Reveal footer starts hiding itself. The footer stays revealed while the scroll is still within this offset.
Size BitSize? null The size of the BitFooter, which determines the paddings around its content.
Sticky bool false Renders the footer with a sticky position at the bottom of the viewport. Unlike Fixed, it stays in the normal flow, so it never overlaps the content.
Styles BitFooterClassStyles? null Custom CSS styles for different parts of the BitFooter.
Translucent bool false Softens the background of the BitFooter and blurs what passes behind it, for the frosted glass look of a footer pinned over scrolling content. Only the Fill variant has a background to soften.
Variant BitVariant? null The visual variant of the BitFooter.
VerticalAlign BitAlignment? null Gets or sets the vertical alignment of the content of the BitFooter (the CSS align-items of the container). Only Start, End, Center, Baseline and Stretch align a line on the cross axis, so the three space distributions are ignored here.
Wrap bool false Lets the content of the BitFooter wrap onto more than one line instead of being squeezed into a single one. The lines are packed by VerticalAlign and separated by the row part of Gap.

BitFooter public members

Name Type Default value Description
IsRevealed bool true Gets a value indicating whether the footer is currently revealed. It reports the scroll driven reveal state alone, so it is always true unless Reveal is enabled, and stays true for a footer slid out of the view with Hidden.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters.
Id string? null Gets or sets the unique identifier for the component's root element.
IsEnabled bool true Gets or sets a value indicating whether the component is enabled and can respond to user interaction.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitAlignment enum

Name Value Description
Start 0 Packs the content at the start of the line, or at the top of the footer.
End 1 Packs the content at the end of the line, or at the bottom of the footer.
Center 2 Packs the content at the center of the line, or in the middle of the footer.
SpaceBetween 3 Distributes the free space between the items, with no space at the two edges. Ignored by VerticalAlign.
SpaceAround 4 Distributes the free space around the items, so the edges get half of what sits between the items. Ignored by VerticalAlign.
SpaceEvenly 5 Distributes the free space evenly between the items and at the two edges. Ignored by VerticalAlign.
Baseline 6 Aligns the content on its baseline (the cross axis of the footer).
Stretch 7 Stretches the content to the full height of the footer (the cross axis).

BitColor enum

Name Value Description
Primary 0 Primary general color.
Secondary 1 Secondary general color.
Tertiary 2 Tertiary general color.
Info 3 Info general color.
Success 4 Success general color.
Warning 5 Warning general color.
SevereWarning 6 SevereWarning general color.
Error 7 Error general color.
PrimaryBackground 8 Primary background color.
SecondaryBackground 9 Secondary background color.
TertiaryBackground 10 Tertiary background color.
PrimaryForeground 11 Primary foreground color.
SecondaryForeground 12 Secondary foreground color.
TertiaryForeground 13 Tertiary foreground color.
PrimaryBorder 14 Primary border color.
SecondaryBorder 15 Secondary border color.
TertiaryBorder 16 Tertiary border color.

BitSize enum

Name Value Description
Small 0 The small size.
Medium 1 The medium size.
Large 2 The large size.

BitVariant enum

Name Value Description
Fill 0 Fill styled variant.
Outline 1 Outline styled variant.
Text 2 Text styled variant.

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.