Skip to content
Client v5: BLE, BLE Hosting, HTTP, Jobs - Linux, MacOS, & Blazor Support! Full AOT, RX on BLE only & MANY other features! Power up!

Toolbar & TabBar | ShinyTabBar

ShinyTabBar is a mobile-style tab bar pinned to the bottom (or top) of the viewport with a selected state, optional filled active icons, badges, and a frosted-glass option. It uses position: fixed by default, so it stays pinned regardless of scroll.

@using Shiny.Blazor.Controls

No service registration is required — it’s a plain Razor component.

Two-way bind SelectedKey for the active tab. Give an item an ActiveIcon for a filled selected state, and a Badge (use "" for a plain dot).

<ShinyTabBar Items="@tabs"
@bind-SelectedKey="selected"
ActiveColor="#7C3AED"
Frosted="true" />
@code {
string? selected = "home";
List<TabBarItem> tabs = new()
{
new() { Key = "home", Label = "Home", Icon = HomeOutline, ActiveIcon = HomeFilled },
new() { Key = "search", Label = "Search", Icon = SearchIcon },
new() { Key = "chat", Label = "Chat", Icon = ChatIcon, Badge = "5" },
new() { Key = "profile", Label = "Profile", Icon = ProfileIcon, Href = "/profile" }
};
}
<ShinyTabBar Items="@tabs"
@bind-SelectedKey="selected"
ShowLabels="false"
BackgroundColor="#0F172A"
ActiveColor="#38BDF8"
InactiveColor="#64748B" />
PropertyTypeDefaultDescription
ItemsList<TabBarItem>?nullThe tabs
SelectedKeystring?nullTwo-way bindable active tab Key (pair with SelectedKeyChanged)
SelectedKeyChangedEventCallback<string?>Fires when the selected tab changes
DockToolbarDockBottomDocks to the Bottom (default) or Top edge
Fixedbooltrueposition:fixed (always pinned); set false to use sticky inside a container
BackgroundColorstring#FFFFFFSolid fill (ignored when Frosted)
ActiveColorstring#2196F3Selected tab color
InactiveColorstring#9CA3AFUnselected tab color
ShowLabelsbooltrueShow each tab’s Label beneath its icon
Heightdouble56Bar height (min-height) in pixels
IconSizedouble24Tab icon size in pixels
FrostedboolfalseFrosted glass via backdrop-filter
BlurRadiusdouble20Blur amount in pixels when Frosted
TintColorstringrgba(255,255,255,0.7)Translucent fill when Frosted
HasShadowbooltrueEdge shadow (direction follows Dock)
BorderColorstring?nullHairline color on the docked edge
BorderThicknessdouble0Hairline thickness in pixels
SafeAreabooltrueAdds env(safe-area-inset-bottom) padding (home-indicator clearance)
ZIndexint100Stacking order
CssClassstring?nullExtra root CSS class
Stylestring?nullExtra inline style appended to the root

Events: SelectedKeyChanged (two-way bind via @bind-SelectedKey), ItemClicked — fires the tapped TabBarItem.

PropertyTypeDefaultDescription
Keystring?nullStable identifier used for selection
Iconstring?nullInline SVG/HTML, a glyph/emoji, or an image URL (shown when inactive)
ActiveIconstring?nullOptional filled variant shown when the tab is selected
Labelstring?nullLabel beneath the icon (hidden when ShowLabels is false)
Hrefstring?nullWhen set, selecting the tab also navigates here
Badgestring?nullBadge text; an empty string "" renders a dot
IsDisabledboolfalseDims the tab and blocks selection
Tagobject?nullArbitrary payload returned via ItemClicked