Components
NavBar
Floating glass bottom navigation — equal tabs in a frosted pill over a midnight fade, collapsing to icons on scroll.
Figma description ·
navbarOpen in Figma ↗Props
// Floating glass pill (white 15% + blur, no border) over a midnight fade, 4 equal tabs. // Active tab = solid white pill, red 32pt icon + body/xs label (Regular, not bold). // Scrolling down collapses the bar to icons only. import SwiftUI import EandTokens struct NavTab: View { let title: String; let icon: Image; let active: Bool var body: some View { VStack(spacing: 0) { icon.frame(width: EandIcon.icon2xl, height: EandIcon.icon2xl) Text(title).font(.system(size: EandTypography.bodyXs.size)) } .foregroundColor(active ? EandColor.navbarTabTextSelected : EandColor.navbarTabTextDefault) .padding(.bottom, EandSpacing.xs) .frame(maxWidth: .infinity) .background(active ? EandColor.navbarTabSurfaceSelected : .clear) .clipShape(Capsule()) .padding(.vertical, EandSpacing.xs) } } // Bar: HStack(spacing: 0) { tabs } // .padding(.horizontal, EandSpacing.xs) // .background(EandColor.surfaceGlassWhiteMd).background(.ultraThinMaterial) // .clipShape(Capsule())
When to use
- Use on the app's top-level screens to move between primary destinations. Mark the
current destination
active. - Don't use on pushed pages or inside flows; those take a TopBar with
onBack. Not for switching views within a page (use Tabs).
Anatomy
- Scrim — a midnight gradient behind the bar so it reads over any content.
- Bar — one frosted pill of equal-width tabs.
- Tab — an
icon(or anavatar, such as the profile picture) over alabel. The active tab sits on a white pill; its label stays Regular. - Home indicator — a 34px block holding the 144 × 5 bar.
Set scrollDirection="down" while the page scrolls down: the labels hide, the pills shrink to
36px and the bar narrows. up (default) restores it. Both transitions are animated.
<NavBar
items={[
{ label: 'Home', icon: <Icon name="home" size={24} />, active: true },
{ label: 'Shop', icon: <Icon name="shop" size={24} /> },
{ label: 'Care', icon: <Icon name="support-agent" size={24} /> },
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | NavItem[] | — | |
scrollDirection? | 'up' | 'down' | up | Figma .navbar-scroll axis. down collapses to icons only (scrolled down);
up (default) shows icon + label. Transitions are animated. |
Design
Figma source: navbar — etisalat Consumer App DSL V1.2
- Scrim padding-top 16 (
spacing/lg); the gradient runs from transparent midnight to 40% at 48% and 70% at the bottom. Figma leaves it unbound, so it is a literal. - Bar:
surface/glass/white/mdwith a 20px blur, no stroke, 4px side padding (spacing/xs), and no gap between tabs. Side margins are 16, or 48 when collapsed (spacing/5xl). - Tab: a 4px wrapper top and bottom, a 32px icon box and a
body/xslabel (10px, 140%). Colours bindnavbar-tab/text/default,navbar-tab/text/selectedandnavbar-tab/surface/selected. - Home indicator: the bar sits 21px down a 34px block, in
surface/raised/default.