Android — Material 3 JS behaviour

Navigation bar

Material’s bottom navigation bar: the active pill glides between destinations, labels only fill for the active one, and icons carry badges; the pill moves on Material’s official curve.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

Four destinations, one pill

Switch tabs — the secondary-container pill glides under the icons on Material’s emphasized curve, labels fill only for the active destination, and the badges ride along.

Good evening, Sara

Continue where you stopped last night
Night tar suiteKayhan Kalhor · 12 min left
Shiraz alleysSima Bina · track 4 of 9
Morning run mixRastak · fresh this week

Explore

Genres tuned to your listening
Traditional Pop Nature sounds Podcasts

Library

142 tracks · 18 albums · downloaded: 9
Hirkanic morningsPlaylist · 31 tracks
Albums of the yearPlaylist · 24 tracks

Profile

Nabu Premium · renews on Azar 15
Sara Novak4 hours of listening this week

Badges: a dot for the quiet hint, a count clamped like 3+ for the noisy one — both in the error colour, per spec.

Important props

Important props
Prop Type Default What it does
active-indicator pill '64 × 32' A 64×32 secondary-container pill behind the active icon.
destinations count '3–5' Material recommends three to five destinations.
badge dot|count 'dot' A dot or a count; counts clamp to 9+.

Snippet

<nav class="m3nav">
    <button class="m3nav-item" data-current><span class="m3nav-pill">🏠</span><span>خانه</span></button>
    <button class="m3nav-item"><span class="m3nav-pill" data-badge="3">🔍</span><span>جست‌وجو</span></button>
</nav>

<style>
.m3nav { display: flex; block-size: 80px; background: #F3EDF7; }
.m3nav-pill { display: grid; place-items: center; inline-size: 64px; block-size: 32px;
              border-radius: 999px; transition: translate .3s cubic-bezier(.2,0,0,1); }
.m3nav-item[data-current] .m3nav-pill { background: #E8DEF8; }
.m3nav-item:not([data-current]) { color: #49454F; }
</style>