md-navigation-bar spec card
Identity · when to use / when NOT · decision cues · behavioural contract · do/don't · anti-patterns · full API. Paste into your agent when you're implementing with this component.
Top-level destinations on a compact screen. A bottom bar of 3–5
destinations. The bar owns the active index, the roving keyboard focus and the
single active indicator across its md-navigation-tab
children — it does not route.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 380px;">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '380px' }}>
<MdNavigationBar activeIndex="0" aria-label="Main">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Library" icon="library_music"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person" badgeValue="3"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 380px;">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 380px;">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 380px;">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
Already installed? See the
Installation guide for one-time package setup
(core + tokens, fonts). Each tab below shows two patterns for using
md-navigation-bar in your project: Option A registers every AWC UI
component at once (simplest), Option B imports only this component for
tree-shake-friendly bundles.
<!-- ─── Option A: global registration (all components) ─── -->
<script type="module">
import '@awc-ui/core/define';
</script>
<!-- ─── Option B: single import (tree-shake only md-navigation-bar) ─── -->
<script type="module">
import '@awc-ui/core/components/md-navigation-bar';
</script>
<md-navigation-bar></md-navigation-bar>// ─── Option A: typed React wrapper (registers all components) ───
// Importing from '@awc-ui/react' calls defineCustomElements() as a
// side effect, so every md-* element becomes available in the browser.
import { MdNavigationBar } from '@awc-ui/react';
export function Example() {
return <MdNavigationBar></MdNavigationBar>;
}
// ─── Option B: single import (tree-shake to only md-navigation-bar) ───
// Skip the wrapper and use the raw custom element. Smallest bundle,
// but you lose typed props/events on JSX.
import '@awc-ui/core/components/md-navigation-bar';
export function ExampleTreeShaken() {
return <md-navigation-bar></md-navigation-bar>;
}// ─── Option A: schema module (any md-* element accepted) ───
// Pair with `defineCustomElements(window)` in main.ts.
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `<md-navigation-bar></md-navigation-bar>`,
})
export class ExampleComponent {}
// ─── Option B: typed directive (tree-shake friendly) ───
// Pair with `import '@awc-ui/core/components/md-navigation-bar'` in main.ts.
import { Component } from '@angular/core';
import { MdNavigationBar } from '@awc-ui/angular';
@Component({
standalone: true,
imports: [MdNavigationBar],
template: `<md-navigation-bar></md-navigation-bar>`,
})
export class ExampleTreeShakenComponent {}<!-- ─── Option A: typed Vue wrapper (registers all components) ─── -->
<script setup lang="ts">
import { MdNavigationBar } from '@awc-ui/vue';
</script>
<template>
<MdNavigationBar></MdNavigationBar>
</template>
<!-- ─── Option B: single import (tree-shake to only md-navigation-bar) ─── -->
<script setup lang="ts">
import '@awc-ui/core/components/md-navigation-bar';
</script>
<template>
<md-navigation-bar></md-navigation-bar>
</template><!-- ─── Option A: global registration (done once in main entry) ─── -->
<!-- main.ts: -->
<!-- import { defineCustomElements } from '@awc-ui/svelte'; -->
<!-- defineCustomElements(window); -->
<md-navigation-bar></md-navigation-bar>
<!-- ─── Option B: single import (tree-shake to only md-navigation-bar) ─── -->
<script lang="ts">
import '@awc-ui/core/components/md-navigation-bar';
</script>
<md-navigation-bar></md-navigation-bar>active-index is the
single source of truth for the one active indicator.| Situation | Use instead |
|---|---|
| Fewer than three destinations | md-tabs |
| More than five destinations | A rail, a drawer, or a menu |
| Desktop / large layouts | md-navigation-rail or md-tabs |
| Sibling views inside one screen | md-tabs |
| Actions rather than destinations | md-toolbar / md-button-group |
| A linear flow | md-stepper |
| Secondary navigation | md-tabs |
M3 caps the bar at five destinations and requires at least three. Two
destinations belong in md-tabs; six or more belong in a
rail or drawer.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="0" aria-label="Three destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Five destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '340px' }}>
<MdNavigationBar activeIndex="0" aria-label="Three destinations">
<MdNavigationTab label="Home" icon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
<div style={{ inlineSize: '100%', maxInlineSize: '400px' }}>
<MdNavigationBar activeIndex="0" aria-label="Five destinations">
<MdNavigationTab label="Home" icon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Library" icon="library_music"></MdNavigationTab>
<MdNavigationTab label="Inbox" icon="inbox"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="0" aria-label="Three destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Five destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="0" aria-label="Three destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Five destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="0" aria-label="Three destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Five destinations">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music"></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>label-behavior is always by default, which is the M3 baseline. selected
and none exist for constrained layouts, but M3 says don’t remove labels from
navigation items — reach for them only when you have measured that you must.
A child tab can override the bar with its own label-behavior.
| Value | Result |
|---|---|
always | Default. Every destination shows its label |
selected | Only the active destination’s label is painted |
none | Icon-only; the label is still the accessible name |
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="always" active-index="0" aria-label="Labels always">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="selected" active-index="0" aria-label="Labels selected only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="none" active-index="0" aria-label="Icon only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '340px' }}>
<MdNavigationBar labelBehavior="always" activeIndex="0" aria-label="Labels always">
<MdNavigationTab label="Home" icon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
<div style={{ inlineSize: '100%', maxInlineSize: '340px' }}>
<MdNavigationBar labelBehavior="selected" activeIndex="0" aria-label="Labels selected only">
<MdNavigationTab label="Home" icon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
<div style={{ inlineSize: '100%', maxInlineSize: '340px' }}>
<MdNavigationBar labelBehavior="none" activeIndex="0" aria-label="Icon only">
<MdNavigationTab label="Home" icon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="always" active-index="0" aria-label="Labels always">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="selected" active-index="0" aria-label="Labels selected only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="none" active-index="0" aria-label="Icon only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="always" active-index="0" aria-label="Labels always">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="selected" active-index="0" aria-label="Labels selected only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="none" active-index="0" aria-label="Icon only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="always" active-index="0" aria-label="Labels always">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="selected" active-index="0" aria-label="Labels selected only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar label-behavior="none" active-index="0" aria-label="Icon only">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>M3 requires the active destination to differ from the inactive ones — a filled
glyph, or a heavier weight when no filled variant exists. Pass both icon and
active-icon on the tab and the swap is automatic.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="1" aria-label="Filled active icon">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Favorites" icon="favorite" active-icon="favorite"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" active-icon="settings"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '340px' }}>
<MdNavigationBar activeIndex="1" aria-label="Filled active icon">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Favorites" icon="favorite" activeIcon="favorite"></MdNavigationTab>
<MdNavigationTab label="Settings" icon="settings" activeIcon="settings"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="1" aria-label="Filled active icon">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Favorites" icon="favorite" active-icon="favorite"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" active-icon="settings"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="1" aria-label="Filled active icon">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Favorites" icon="favorite" active-icon="favorite"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" active-icon="settings"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar active-index="1" aria-label="Filled active icon">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Favorites" icon="favorite" active-icon="favorite"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" active-icon="settings"></md-navigation-tab>
</md-navigation-bar>
</div>icon and active-icon are also slots, for artwork the Material Symbols
names cannot express. A slot beats the matching prop.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="0" aria-label="Slotted icons">
<md-navigation-tab label="Home">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l9-8 9 8v10h-6v-6H9v6H3z"/></svg>
<svg slot="active-icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 3l9 8h-3v10h-5v-6h-2v6H6V11H3z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Starred">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '420px' }}>
<MdNavigationBar activeIndex="0" aria-label="Slotted icons">
<MdNavigationTab label="Home">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l9-8 9 8v10h-6v-6H9v6H3z"/></svg>
<svg slot="active-icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 3l9 8h-3v10h-5v-6h-2v6H6V11H3z"/></svg>
</MdNavigationTab>
<MdNavigationTab label="Starred">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"/></svg>
</MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="0" aria-label="Slotted icons">
<md-navigation-tab label="Home">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l9-8 9 8v10h-6v-6H9v6H3z"/></svg>
<svg slot="active-icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 3l9 8h-3v10h-5v-6h-2v6H6V11H3z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Starred">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="0" aria-label="Slotted icons">
<md-navigation-tab label="Home">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l9-8 9 8v10h-6v-6H9v6H3z"/></svg>
<svg slot="active-icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 3l9 8h-3v10h-5v-6h-2v6H6V11H3z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Starred">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="0" aria-label="Slotted icons">
<md-navigation-tab label="Home">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l9-8 9 8v10h-6v-6H9v6H3z"/></svg>
<svg slot="active-icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 3l9 8h-3v10h-5v-6h-2v6H6V11H3z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Starred">
<svg slot="icon" viewBox="0 0 24 24" width="24" height="24" fill="currentColor"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"/></svg>
</md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>badge is the boolean switch for the small dot. badge-value renders the
large pill; numeric values above badge-max (default 999) collapse to
"999+".
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Badges">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Alerts" icon="notifications" badge></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox" badge-value="1500"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '400px' }}>
<MdNavigationBar activeIndex="0" aria-label="Badges">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Messages" icon="chat" badgeValue="3"></MdNavigationTab>
<MdNavigationTab label="Alerts" icon="notifications" badge></MdNavigationTab>
<MdNavigationTab label="Inbox" icon="inbox" badgeValue="1500"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Badges">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Alerts" icon="notifications" badge></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox" badge-value="1500"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Badges">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Alerts" icon="notifications" badge></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox" badge-value="1500"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="Badges">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Alerts" icon="notifications" badge></md-navigation-tab>
<md-navigation-tab label="Inbox" icon="inbox" badge-value="1500"></md-navigation-tab>
</md-navigation-bar>
</div>disabled leaves the tab order entirely. soft-disabled stays keyboard
reachable, so the arrow-key tour still lands on a temporarily unavailable
destination and screen-reader users can discover it.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="States">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search" disabled></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music" soft-disabled></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '400px' }}>
<MdNavigationBar activeIndex="0" aria-label="States">
<MdNavigationTab label="Home" icon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search" disabled></MdNavigationTab>
<MdNavigationTab label="Library" icon="library_music" soft-disabled></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="States">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search" disabled></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music" soft-disabled></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="States">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search" disabled></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music" soft-disabled></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 400px;">
<md-navigation-bar active-index="0" aria-label="States">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search" disabled></md-navigation-tab>
<md-navigation-tab label="Library" icon="library_music" soft-disabled></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>select(index) clamps to the next enabled tab when the target is disabled, so
programmatic navigation never lands on a dead destination.
By default, arrow keys move focus and activate — the MD3 reference
behaviour. Set manual-activation when switching destinations is expensive or
destructive: arrows then only preview, and Enter / Space commits.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar manual-activation active-index="0" aria-label="Manual activation">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Reports" icon="assessment"></md-navigation-tab>
<md-navigation-tab label="Sync" icon="sync"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '340px' }}>
<MdNavigationBar manualActivation activeIndex="0" aria-label="Manual activation">
<MdNavigationTab label="Home" icon="home"></MdNavigationTab>
<MdNavigationTab label="Reports" icon="assessment"></MdNavigationTab>
<MdNavigationTab label="Sync" icon="sync"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar manual-activation active-index="0" aria-label="Manual activation">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Reports" icon="assessment"></md-navigation-tab>
<md-navigation-tab label="Sync" icon="sync"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar manual-activation active-index="0" aria-label="Manual activation">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Reports" icon="assessment"></md-navigation-tab>
<md-navigation-tab label="Sync" icon="sync"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 340px;">
<md-navigation-bar manual-activation active-index="0" aria-label="Manual activation">
<md-navigation-tab label="Home" icon="home"></md-navigation-tab>
<md-navigation-tab label="Reports" icon="assessment"></md-navigation-tab>
<md-navigation-tab label="Sync" icon="sync"></md-navigation-tab>
</md-navigation-bar>
</div>The bar does not position itself. Fix it to the bottom edge yourself, and pad the page so content isn’t hidden behind it.
<md-navigation-bar style="position: fixed; inset-inline: 0; inset-block-end: 0;"> …</md-navigation-bar><!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="position:relative; inline-size:100%; max-inline-size:320px; block-size:300px; overflow:hidden; border:1px solid var(--md-sys-color-outline-variant); border-radius:16px;">
<div style="block-size:100%; overflow-y:auto; padding:16px; padding-block-end:96px; font: var(--md-sys-typescale-body-medium); color: var(--md-sys-color-on-surface);">
<p style="margin:0 0 12px;">Scroll this panel.</p>
<p style="margin:0 0 12px;">The bar is pinned to the bottom edge of the screen, so it never scrolls with the content.</p>
<p style="margin:0 0 12px;">The content pane carries the bottom padding instead — without it, the last line of text would sit underneath the bar and be unreadable.</p>
<p style="margin:0 0 12px;">Keep scrolling.</p>
<p style="margin:0;">This last line clears the bar because of that padding.</p>
</div>
<md-navigation-bar active-index="0" aria-label="Main" style="position:absolute; inset-inline:0; inset-block-end:0; --md-navigation-bar-container-elevation: var(--md-sys-elevation-2);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ position: 'relative', inlineSize: '100%', maxInlineSize: '320px', blockSize: '300px', overflow: 'hidden', border: '1px solid var(--md-sys-color-outline-variant)', borderRadius: '16px' }}>
<div style={{ blockSize: '100%', overflowY: 'auto', padding: '16px', paddingBlockEnd: '96px', font: 'var(--md-sys-typescale-body-medium)', color: 'var(--md-sys-color-on-surface)' }}>
<p style={{ margin: '0 0 12px' }}>Scroll this panel.</p>
<p style={{ margin: '0 0 12px' }}>The bar is pinned to the bottom edge of the screen, so it never scrolls with the content.</p>
<p style={{ margin: '0 0 12px' }}>The content pane carries the bottom padding instead — without it, the last line of text would sit underneath the bar and be unreadable.</p>
<p style={{ margin: '0 0 12px' }}>Keep scrolling.</p>
<p style={{ margin: '0' }}>This last line clears the bar because of that padding.</p>
</div>
<MdNavigationBar activeIndex="0" aria-label="Main" style={{ position: 'absolute', insetInline: '0', insetBlockEnd: '0', '--md-navigation-bar-container-elevation': 'var(--md-sys-elevation-2)' }}>
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="position:relative; inline-size:100%; max-inline-size:320px; block-size:300px; overflow:hidden; border:1px solid var(--md-sys-color-outline-variant); border-radius:16px;">
<div style="block-size:100%; overflow-y:auto; padding:16px; padding-block-end:96px; font: var(--md-sys-typescale-body-medium); color: var(--md-sys-color-on-surface);">
<p style="margin:0 0 12px;">Scroll this panel.</p>
<p style="margin:0 0 12px;">The bar is pinned to the bottom edge of the screen, so it never scrolls with the content.</p>
<p style="margin:0 0 12px;">The content pane carries the bottom padding instead — without it, the last line of text would sit underneath the bar and be unreadable.</p>
<p style="margin:0 0 12px;">Keep scrolling.</p>
<p style="margin:0;">This last line clears the bar because of that padding.</p>
</div>
<md-navigation-bar active-index="0" aria-label="Main" style="position:absolute; inset-inline:0; inset-block-end:0; --md-navigation-bar-container-elevation: var(--md-sys-elevation-2);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="position:relative; inline-size:100%; max-inline-size:320px; block-size:300px; overflow:hidden; border:1px solid var(--md-sys-color-outline-variant); border-radius:16px;">
<div style="block-size:100%; overflow-y:auto; padding:16px; padding-block-end:96px; font: var(--md-sys-typescale-body-medium); color: var(--md-sys-color-on-surface);">
<p style="margin:0 0 12px;">Scroll this panel.</p>
<p style="margin:0 0 12px;">The bar is pinned to the bottom edge of the screen, so it never scrolls with the content.</p>
<p style="margin:0 0 12px;">The content pane carries the bottom padding instead — without it, the last line of text would sit underneath the bar and be unreadable.</p>
<p style="margin:0 0 12px;">Keep scrolling.</p>
<p style="margin:0;">This last line clears the bar because of that padding.</p>
</div>
<md-navigation-bar active-index="0" aria-label="Main" style="position:absolute; inset-inline:0; inset-block-end:0; --md-navigation-bar-container-elevation: var(--md-sys-elevation-2);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="position:relative; inline-size:100%; max-inline-size:320px; block-size:300px; overflow:hidden; border:1px solid var(--md-sys-color-outline-variant); border-radius:16px;">
<div style="block-size:100%; overflow-y:auto; padding:16px; padding-block-end:96px; font: var(--md-sys-typescale-body-medium); color: var(--md-sys-color-on-surface);">
<p style="margin:0 0 12px;">Scroll this panel.</p>
<p style="margin:0 0 12px;">The bar is pinned to the bottom edge of the screen, so it never scrolls with the content.</p>
<p style="margin:0 0 12px;">The content pane carries the bottom padding instead — without it, the last line of text would sit underneath the bar and be unreadable.</p>
<p style="margin:0 0 12px;">Keep scrolling.</p>
<p style="margin:0;">This last line clears the bar because of that padding.</p>
</div>
<md-navigation-bar active-index="0" aria-label="Main" style="position:absolute; inset-inline:0; inset-block-end:0; --md-navigation-bar-container-elevation: var(--md-sys-elevation-2);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>The demo pins the bar with position: absolute so it stays inside this page; in
a real app the viewport is the shell and you want position: fixed. Either way
the padding on the content pane is what keeps the last line readable.
| Event | Cancelable | Detail | Fires |
|---|---|---|---|
mdChange | no | { index, previousIndex } | The selected destination changed — click, keyboard activation, or select() |
// mdChange detail{ index: number; // the destination now selected previousIndex: number; // the one it replaced}mdChange only fires on a real change, so index and previousIndex are
never equal and a no-op reselect guard would be dead code — previousIndex is
there to tell you where the user came from (direction, analytics, restoring the
previous view’s scroll). Re-clicking the already active destination emits
nothing; if you need that (scroll-to-top on a second tap, say) listen for the
child’s mdTabClick instead.
<md-navigation-bar id="nav" active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
<script type="module">
const nav = document.getElementById('nav');
nav.addEventListener('mdChange', (e) => {
const { index, previousIndex } = e.detail;
console.log('destination', index, 'was', previousIndex);
});
// Re-tapping the active destination: listen on the bar, not an ancestor —
// and in the CAPTURE phase. The bar's own bubble-phase handler sets
// activeIndex before a bubble listener runs, so this would otherwise be
// true on every tap.
nav.addEventListener(
'mdTabClick',
(e) => {
if (e.detail.index === nav.activeIndex) window.scrollTo({ top: 0 });
},
{ capture: true },
);
</script>import { useState } from 'react';
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function BottomNav() {
const [index, setIndex] = useState(0);
return (
<MdNavigationBar
activeIndex={index}
aria-label="Main"
onMdChange={(e) => setIndex(e.detail.index)}
>
<MdNavigationTab label="Home" icon="home" activeIcon="home" />
<MdNavigationTab label="Search" icon="search" />
<MdNavigationTab label="Messages" icon="chat" badgeValue="3" />
</MdNavigationBar>
);
}import { Component } from '@angular/core';
@Component({
selector: 'app-bottom-nav',
template: `
<md-navigation-bar
[attr.active-index]="index"
aria-label="Main"
(mdChange)="onChange($event)"
>
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
`,
})
export class BottomNavComponent {
index = 0;
onChange(e: CustomEvent<{ index: number; previousIndex: number }>) {
this.index = e.detail.index;
}
}<script setup lang="ts">
import { ref } from 'vue';
const index = ref(0);
function onChange(e: CustomEvent) {
index.value = e.detail.index;
}
</script>
<template>
<md-navigation-bar :active-index="index" aria-label="Main" @mdChange="onChange">
<md-navigation-tab label="Home" icon="home" active-icon="home" />
<md-navigation-tab label="Search" icon="search" />
<md-navigation-tab label="Messages" icon="chat" badge-value="3" />
</md-navigation-bar>
</template><script lang="ts">
let index = 0;
function onChange(e: CustomEvent) {
index = e.detail.index;
}
</script>
<md-navigation-bar active-index={index} aria-label="Main" on:mdChange={onChange}>
<md-navigation-tab label="Home" icon="home" active-icon="home" />
<md-navigation-tab label="Search" icon="search" />
<md-navigation-tab label="Messages" icon="chat" badge-value="3" />
</md-navigation-bar>Routing is the step the markup cannot express: the bar reports the change, and
your router does the navigating. Keep the bar in sync the other way with
select(index) when the router moves on its own.
<md-navigation-bar id="nav" active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<script type="module">
const routes = ['/', '/search', '/profile'];
const nav = document.getElementById('nav');
nav.addEventListener('mdChange', (e) => {
router.go(routes[e.detail.index]);
});
// keep the bar in sync when the router moves on its own
router.afterEach((to) => nav.select(routes.indexOf(to.path)));
</script>import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
import { useNavigate } from 'react-router-dom';
const ROUTES = ['/', '/search', '/profile'];
export function BottomNav({ index }: { index: number }) {
const navigate = useNavigate();
return (
<MdNavigationBar
activeIndex={index}
aria-label="Main"
onMdChange={(e) => navigate(ROUTES[e.detail.index])}
>
<MdNavigationTab label="Home" icon="home" activeIcon="home" />
<MdNavigationTab label="Search" icon="search" />
<MdNavigationTab label="Profile" icon="person" />
</MdNavigationBar>
);
}import { Component } from '@angular/core';
import { Router } from '@angular/router';
const ROUTES = ['/', '/search', '/profile'];
@Component({
selector: 'app-bottom-nav',
template: `
<md-navigation-bar [attr.active-index]="index" aria-label="Main" (mdChange)="onChange($event)">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
`,
})
export class BottomNavComponent {
index = 0;
constructor(private router: Router) {}
onChange(e: CustomEvent<{ index: number; previousIndex: number }>) {
this.index = e.detail.index;
this.router.navigateByUrl(ROUTES[e.detail.index]);
}
}<script setup lang="ts">
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const ROUTES = ['/', '/search', '/profile'];
const index = ref(0);
const router = useRouter();
function onChange(e: CustomEvent) {
index.value = e.detail.index;
router.push(ROUTES[e.detail.index]);
}
</script>
<template>
<md-navigation-bar :active-index="index" aria-label="Main" @mdChange="onChange">
<md-navigation-tab label="Home" icon="home" active-icon="home" />
<md-navigation-tab label="Search" icon="search" />
<md-navigation-tab label="Profile" icon="person" />
</md-navigation-bar>
</template><script lang="ts">
import { goto } from '$app/navigation';
const ROUTES = ['/', '/search', '/profile'];
let index = 0;
function onChange(e: CustomEvent) {
index = e.detail.index;
goto(ROUTES[e.detail.index]);
}
</script>
<md-navigation-bar active-index={index} aria-label="Main" on:mdChange={onChange}>
<md-navigation-tab label="Home" icon="home" active-icon="home" />
<md-navigation-tab label="Search" icon="search" />
<md-navigation-tab label="Profile" icon="person" />
</md-navigation-bar>| Property | Attribute | Type | Default | Reflects |
|---|---|---|---|---|
activeIndex | active-index | number | 0 | Yes |
labelBehavior | label-behavior | MdNavigationBarLabelBehavior | 'always' | — |
manualActivation | manual-activation | boolean | false | — |
density | density | 0 | -1 | -2 | -3 | -4 | 0 | Yes |
| Method | Parameters |
|---|---|
select() | index: number |
focusTab() | index: number |
| Slot | Description |
|---|---|
(default) | — |
Override on the host element for per-instance theming:
| Property | Description |
|---|---|
--md-navigation-bar-container-color | Background |
--md-navigation-bar-container-height | Total height (default 64px) |
--md-navigation-bar-container-shape | Outer corner radius |
--md-navigation-bar-divider-color | Optional top border color |
--md-navigation-bar-divider-width | Optional top border width |
--md-navigation-bar-z-index | Stacking order |
--md-navigation-bar-container-elevation | — |
Style internal elements through shadow DOM with ::part():
| Part | Description |
|---|---|
container | The inner `tablist` flex row. |
The bar is composed from one sub-component, documented here rather than on its
own page: it means nothing outside md-navigation-bar, which owns the active
index and the indicator.
md-navigation-tabOne destination in the bar — an icon, a label, an active indicator and an optional badge.
active is managed by the bar via its active-index. Setting it on
several tabs breaks M3’s “one indicator at a time” rule.active-icon is how you satisfy M3’s filled-when-active requirement. Without
it the same glyph shows in both states — with a Material Symbols variable font
the FILL axis is toggled too.badge is the boolean on-switch; badge-value supplies the count.
badge-value alone still renders a badge as the large pill, but the dot form
needs badge. Numeric values above badge-max (default 999) render as
"999+"; set badge-max="0" to disable the cap.href is scripted navigation, not a link. The tab renders no anchor: it
stays role="tab", and a click calls location.assign(href) — or
window.open(href, target) when target is set. So there is no middle-click,
no open-in-new-tab, no copy-link-address and no URL in the status bar, and
assistive tech announces a tab rather than a link. Call preventDefault() on
the native click to suppress it for SPA routing, or skip href altogether and
route from the bar’s mdChange.label-behavior exists per tab as well as on the bar, and is not reflected
as an attribute: the bar reads getAttribute('label-behavior') to detect an
explicit author override, so reflecting the default would defeat that signal.mdTabClick { index } is the internal signal the bar listens to — and
stops, so it never bubbles past the bar. Use it only when you need the
re-click of an already-active destination, binding it to the bar or the tab;
application code listens for the bar’s mdChange.focusEl() moves focus to the destination without selecting it. The bar’s own
focusTab(index) is the usual way in.| Property | Attribute | Type | Default | Reflects |
|---|---|---|---|---|
active | active | boolean | false | Yes |
disabled | disabled | boolean | false | Yes |
softDisabled | soft-disabled | boolean | false | Yes |
label | label | string | '' | — |
icon | icon | string | '' | — |
activeIcon | active-icon | string | '' | — |
badge | badge | boolean | false | Yes |
badgeValue | badge-value | string | '' | — |
badgeMax | badge-max | number | 999 | — |
href | href | string | '' | — |
target | target | string | '' | — |
labelBehavior | label-behavior | MdNavigationTabLabelBehavior | 'always' | — |
density | density | 0 | -1 | -2 | -3 | -4 | 0 | Yes |
| Method | Parameters |
|---|---|
focusEl() | none |
| Slot | Description |
|---|---|
(default) | — |
active-icon | — |
icon | — |
Override on the host element for per-instance theming:
| Property | Description |
|---|---|
--md-navigation-tab-active-indicator-width | (default 56px) |
--md-navigation-tab-active-indicator-height | (default 32px) |
--md-navigation-tab-active-indicator-shape | (default full-rounded) |
--md-navigation-tab-label-font | (label-medium font shorthand) |
--md-navigation-tab-label-font-weight | (active label weight; defaults 600) |
--md-navigation-tab-icon-size | (default 24px) |
--md-navigation-tab-padding-block-start | (default 5px — centers 54px content in 64px bar) |
--md-navigation-tab-padding-block-end | (default 5px) |
--md-navigation-tab-disabled-opacity | (default 0.38) |
--md-navigation-tab-label-font-size | — |
--md-navigation-tab-focus-state-layer-opacity | — |
--md-navigation-tab-slotted-icon-font | — |
Style internal elements through shadow DOM with ::part():
| Part | Description |
|---|---|
icon-container | — |
icon | — |
badge | — |
label | — |
state-layer | — |
container | — |
indicator | — |
tablist container and manages roving focus across
destinations; arrow keys move, and activation follows manual-activation.label-behavior="none" still keeps the
label as the name.aria-label (“Inbox, 12 unread”) and keep it in sync.soft-disabled over disabled for destinations worth discovering.| Key | Action |
|---|---|
Tab | One stop for the whole bar (roving tabindex) |
← / → | Move between destinations, wrapping at the ends (mirrored under dir="rtl") |
Home / End | First / last destination |
Enter / Space | Commits the destination — required only with manual-activation |
Tab into the bar below: one press lands on the active destination, not on the
first one, and the arrow keys take over from there. Settings is
soft-disabled, so the tour still visits it and a screen reader still announces
it — it simply refuses to activate.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Main navigation">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" soft-disabled></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '420px' }}>
<MdNavigationBar activeIndex="1" aria-label="Main navigation">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Messages" icon="chat" badgeValue="3"></MdNavigationTab>
<MdNavigationTab label="Settings" icon="settings" soft-disabled></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Main navigation">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" soft-disabled></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Main navigation">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" soft-disabled></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Main navigation">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Settings" icon="settings" soft-disabled></md-navigation-tab>
</md-navigation-bar>
</div>RTL — destination order, indicator movement and badge placement follow
reading order under dir="rtl", and the arrow keys invert with them: ←
advances, → goes back. Nothing on the bar changes — the same markup works in
both directions. See RTL.
<div dir="rtl"> <md-navigation-bar active-index="0" aria-label="التنقل">…</md-navigation-bar></div><!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<div dir="ltr">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
<div dir="rtl">
<md-navigation-bar active-index="0" aria-label="التنقل">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gap: '20px', inlineSize: '100%', maxInlineSize: '420px' }}>
<div dir="ltr">
<MdNavigationBar activeIndex="0" aria-label="Main">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Messages" icon="chat" badgeValue="3"></MdNavigationTab>
</MdNavigationBar>
</div>
<div dir="rtl">
<MdNavigationBar activeIndex="0" aria-label="التنقل">
<MdNavigationTab label="الرئيسية" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="بحث" icon="search"></MdNavigationTab>
<MdNavigationTab label="الرسائل" icon="chat" badgeValue="3"></MdNavigationTab>
</MdNavigationBar>
</div>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<div dir="ltr">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
<div dir="rtl">
<md-navigation-bar active-index="0" aria-label="التنقل">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<div dir="ltr">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
<div dir="rtl">
<md-navigation-bar active-index="0" aria-label="التنقل">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<div dir="ltr">
<md-navigation-bar active-index="0" aria-label="Main">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
<div dir="rtl">
<md-navigation-bar active-index="0" aria-label="التنقل">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
</div>active-index counts DOM order, not visual orderUnder dir="rtl" the first child paints on the right. That is correct, and
it is not something to “fix” by reversing the children: active-index counts
DOM order, so a reversed list makes index 0 point at what the user reads as
the last destination — and every index your router maps silently inverts with
it. Both bars below are active-index="0".
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="DOM order">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="Reversed children">
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center', inlineSize: '100%', maxInlineSize: '480px' }}>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>correct</span>
<MdNavigationBar dir="rtl" activeIndex="0" aria-label="DOM order">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
<span style={{ inlineSize: '3.5rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>wrong</span>
<MdNavigationBar dir="rtl" activeIndex="0" aria-label="Reversed children">
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="DOM order">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="Reversed children">
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="DOM order">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="Reversed children">
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">correct</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="DOM order">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<span style="inline-size:3.5rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">wrong</span>
<md-navigation-bar dir="rtl" active-index="0" aria-label="Reversed children">
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
</md-navigation-bar>
</div>density="-1…-4" shortens the bar, overriding any inherited data-density
rung; 0 is the default and carries no rule of its own, so it never resets an
inherited rung (see the note below). The container floors at 48px, so the
deepest rungs trim the tab padding rather than the hit area.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<md-navigation-bar density="0" active-index="0" aria-label="d0"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<md-navigation-bar density="-1" active-index="0" aria-label="d1"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<md-navigation-bar density="-2" active-index="0" aria-label="d2"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<md-navigation-bar density="-3" active-index="0" aria-label="d3"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<md-navigation-bar density="-4" active-index="0" aria-label="d4"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: '14px 16px', alignItems: 'center', inlineSize: '100%', maxInlineSize: '480px' }}>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>0</span>
<MdNavigationBar density="0" activeIndex="0" aria-label="d0"><MdNavigationTab label="Home" icon="home"></MdNavigationTab><MdNavigationTab label="Search" icon="search"></MdNavigationTab><MdNavigationTab label="Profile" icon="person"></MdNavigationTab></MdNavigationBar>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-1</span>
<MdNavigationBar density="-1" activeIndex="0" aria-label="d1"><MdNavigationTab label="Home" icon="home"></MdNavigationTab><MdNavigationTab label="Search" icon="search"></MdNavigationTab><MdNavigationTab label="Profile" icon="person"></MdNavigationTab></MdNavigationBar>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-2</span>
<MdNavigationBar density="-2" activeIndex="0" aria-label="d2"><MdNavigationTab label="Home" icon="home"></MdNavigationTab><MdNavigationTab label="Search" icon="search"></MdNavigationTab><MdNavigationTab label="Profile" icon="person"></MdNavigationTab></MdNavigationBar>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-3</span>
<MdNavigationBar density="-3" activeIndex="0" aria-label="d3"><MdNavigationTab label="Home" icon="home"></MdNavigationTab><MdNavigationTab label="Search" icon="search"></MdNavigationTab><MdNavigationTab label="Profile" icon="person"></MdNavigationTab></MdNavigationBar>
<span style={{ inlineSize: '2rem', opacity: '.65', fontSize: '.75rem', fontFamily: 'ui-monospace,monospace' }}>-4</span>
<MdNavigationBar density="-4" activeIndex="0" aria-label="d4"><MdNavigationTab label="Home" icon="home"></MdNavigationTab><MdNavigationTab label="Search" icon="search"></MdNavigationTab><MdNavigationTab label="Profile" icon="person"></MdNavigationTab></MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<md-navigation-bar density="0" active-index="0" aria-label="d0"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<md-navigation-bar density="-1" active-index="0" aria-label="d1"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<md-navigation-bar density="-2" active-index="0" aria-label="d2"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<md-navigation-bar density="-3" active-index="0" aria-label="d3"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<md-navigation-bar density="-4" active-index="0" aria-label="d4"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<md-navigation-bar density="0" active-index="0" aria-label="d0"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<md-navigation-bar density="-1" active-index="0" aria-label="d1"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<md-navigation-bar density="-2" active-index="0" aria-label="d2"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<md-navigation-bar density="-3" active-index="0" aria-label="d3"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<md-navigation-bar density="-4" active-index="0" aria-label="d4"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center;inline-size:100%;max-inline-size:480px;">
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">0</span>
<md-navigation-bar density="0" active-index="0" aria-label="d0"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-1</span>
<md-navigation-bar density="-1" active-index="0" aria-label="d1"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-2</span>
<md-navigation-bar density="-2" active-index="0" aria-label="d2"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-3</span>
<md-navigation-bar density="-3" active-index="0" aria-label="d3"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
<span style="inline-size:2rem;opacity:.65;font-size:.75rem;font-family:ui-monospace,monospace;">-4</span>
<md-navigation-bar density="-4" active-index="0" aria-label="d4"><md-navigation-tab label="Home" icon="home"></md-navigation-tab><md-navigation-tab label="Search" icon="search"></md-navigation-tab><md-navigation-tab label="Profile" icon="person"></md-navigation-tab></md-navigation-bar>
</div>A data-density ancestor and dir="rtl" compose — the rung cascades in, the
direction flips the layout, and a local density on one bar overrides only that
bar. The wrapper below is dir="rtl" data-density="-2"; the second bar drops to
-4 on its own.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div dir="rtl" data-density="-2" style="display:grid;gap:16px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="0" aria-label="Inherited -2">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar density="-4" active-index="0" aria-label="Local -4">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div dir="rtl" data-density="-2" style={{ display: 'grid', gap: '16px', inlineSize: '100%', maxInlineSize: '420px' }}>
<MdNavigationBar activeIndex="0" aria-label="Inherited -2">
<MdNavigationTab label="الرئيسية" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="بحث" icon="search"></MdNavigationTab>
<MdNavigationTab label="الرسائل" icon="chat" badgeValue="3"></MdNavigationTab>
</MdNavigationBar>
<MdNavigationBar density="-4" activeIndex="0" aria-label="Local -4">
<MdNavigationTab label="الرئيسية" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="بحث" icon="search"></MdNavigationTab>
<MdNavigationTab label="الرسائل" icon="chat" badgeValue="3"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div dir="rtl" data-density="-2" style="display:grid;gap:16px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="0" aria-label="Inherited -2">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar density="-4" active-index="0" aria-label="Local -4">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div dir="rtl" data-density="-2" style="display:grid;gap:16px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="0" aria-label="Inherited -2">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar density="-4" active-index="0" aria-label="Local -4">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div dir="rtl" data-density="-2" style="display:grid;gap:16px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="0" aria-label="Inherited -2">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar density="-4" active-index="0" aria-label="Local -4">
<md-navigation-tab label="الرئيسية" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="بحث" icon="search"></md-navigation-tab>
<md-navigation-tab label="الرسائل" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>Density — density="-1…-4" on the bar, or a data-density ancestor for the
whole shell. Either way the signal is one number and every measurement derives
from it. See Density.
i18n — translate every label. M3 forbids both truncation and shrinking the
type, so long translations mean choosing shorter words: a four-destination bar
that fits Home · Search · Messages · Profile can overflow on
Startseite · Suche · Nachrichten · Profil. Check each locale at your narrowest
supported width.
| Custom property | Purpose | Default |
|---|---|---|
--md-navigation-bar-container-color | Bar background | surface-container |
--md-navigation-bar-container-height | Bar height | 64px |
--md-navigation-bar-container-shape | Outer corner radius | 0 |
--md-navigation-bar-container-elevation | Box shadow | none |
--md-navigation-bar-divider-color / -divider-width | Top rule | transparent / 0 |
--md-navigation-bar-z-index | Stacking order | --md-sys-z-index-navigation |
Destination appearance is themed with the --md-navigation-tab-* properties —
see md-navigation-tab.
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 360px;">
<md-navigation-bar active-index="0" aria-label="Themed" style="--md-navigation-bar-container-color: var(--md-sys-color-surface-container-highest); --md-navigation-bar-container-shape: 20px; --md-navigation-bar-divider-width: 1px; --md-navigation-bar-divider-color: var(--md-sys-color-outline-variant);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '360px' }}>
<MdNavigationBar activeIndex="0" aria-label="Themed" style={{ '--md-navigation-bar-container-color': 'var(--md-sys-color-surface-container-highest)', '--md-navigation-bar-container-shape': '20px', '--md-navigation-bar-divider-width': '1px', '--md-navigation-bar-divider-color': 'var(--md-sys-color-outline-variant)' }}>
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 360px;">
<md-navigation-bar active-index="0" aria-label="Themed" style="--md-navigation-bar-container-color: var(--md-sys-color-surface-container-highest); --md-navigation-bar-container-shape: 20px; --md-navigation-bar-divider-width: 1px; --md-navigation-bar-divider-color: var(--md-sys-color-outline-variant);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 360px;">
<md-navigation-bar active-index="0" aria-label="Themed" style="--md-navigation-bar-container-color: var(--md-sys-color-surface-container-highest); --md-navigation-bar-container-shape: 20px; --md-navigation-bar-divider-width: 1px; --md-navigation-bar-divider-color: var(--md-sys-color-outline-variant);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 360px;">
<md-navigation-bar active-index="0" aria-label="Themed" style="--md-navigation-bar-container-color: var(--md-sys-color-surface-container-highest); --md-navigation-bar-container-shape: 20px; --md-navigation-bar-divider-width: 1px; --md-navigation-bar-divider-color: var(--md-sys-color-outline-variant);">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>Every default resolves through an md-sys-color role, so a bar that sets no
custom properties follows the theme on its own:
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Untouched defaults">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ inlineSize: '100%', maxInlineSize: '420px' }}>
<MdNavigationBar activeIndex="1" aria-label="Untouched defaults">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Messages" icon="chat" badgeValue="3"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Untouched defaults">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Untouched defaults">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar active-index="1" aria-label="Untouched defaults">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>The bar owns the container; each destination owns its own colours, indicator and
type. Set the --md-navigation-tab-* properties on the bar and they cascade.
| Custom property | Purpose |
|---|---|
--md-navigation-tab-active-icon-color / -inactive-icon-color | Glyph colour |
--md-navigation-tab-active-label-color / -inactive-label-color | Label colour |
--md-navigation-tab-active-indicator-color | The pill behind the active glyph |
--md-navigation-tab-active-indicator-width / -height / -shape | Indicator box |
--md-navigation-tab-icon-size | Glyph size |
--md-navigation-tab-slotted-icon-font | Font applied to slotted text / emoji glyphs |
--md-navigation-tab-label-font / -font-size / -font-weight | Label type |
--md-navigation-tab-badge-color / -badge-on-color | Badge fill / text |
--md-navigation-tab-hover-state-layer-color / -focus-… / -pressed-… | State layers |
--md-navigation-tab-padding-block-start / -end | Vertical padding |
--md-navigation-tab-disabled-opacity | Disabled dimming |
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="1" aria-label="Tonal indicator" style="--md-navigation-tab-active-indicator-color: var(--md-sys-color-tertiary-container); --md-navigation-tab-active-icon-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-label-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-indicator-shape: 8px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Big glyphs" style="--md-navigation-tab-icon-size: 30px; --md-navigation-tab-active-indicator-width: 72px; --md-navigation-tab-label-font-weight: 700; --md-navigation-tab-label-font-size: 13px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Branded badge" style="--md-navigation-tab-badge-color: #7c4dff; --md-navigation-tab-badge-on-color: #ffffff; --md-navigation-tab-active-indicator-color: #ede7f6; --md-navigation-tab-active-icon-color: #311b92; --md-navigation-tab-active-label-color: #311b92;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="12"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<div style={{ display: 'grid', gap: '20px', inlineSize: '100%', maxInlineSize: '420px' }}>
<MdNavigationBar activeIndex="1" aria-label="Tonal indicator" style={{ '--md-navigation-tab-active-indicator-color': 'var(--md-sys-color-tertiary-container)', '--md-navigation-tab-active-icon-color': 'var(--md-sys-color-on-tertiary-container)', '--md-navigation-tab-active-label-color': 'var(--md-sys-color-on-tertiary-container)', '--md-navigation-tab-active-indicator-shape': '8px' }}>
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
<MdNavigationBar activeIndex="1" aria-label="Big glyphs" style={{ '--md-navigation-tab-icon-size': '30px', '--md-navigation-tab-active-indicator-width': '72px', '--md-navigation-tab-label-font-weight': '700', '--md-navigation-tab-label-font-size': '13px' }}>
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
<MdNavigationBar activeIndex="1" aria-label="Branded badge" style={{ '--md-navigation-tab-badge-color': '#7c4dff', '--md-navigation-tab-badge-on-color': '#ffffff', '--md-navigation-tab-active-indicator-color': '#ede7f6', '--md-navigation-tab-active-icon-color': '#311b92', '--md-navigation-tab-active-label-color': '#311b92' }}>
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Messages" icon="chat" badgeValue="12"></MdNavigationTab>
<MdNavigationTab label="Profile" icon="person"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="1" aria-label="Tonal indicator" style="--md-navigation-tab-active-indicator-color: var(--md-sys-color-tertiary-container); --md-navigation-tab-active-icon-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-label-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-indicator-shape: 8px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Big glyphs" style="--md-navigation-tab-icon-size: 30px; --md-navigation-tab-active-indicator-width: 72px; --md-navigation-tab-label-font-weight: 700; --md-navigation-tab-label-font-size: 13px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Branded badge" style="--md-navigation-tab-badge-color: #7c4dff; --md-navigation-tab-badge-on-color: #ffffff; --md-navigation-tab-active-indicator-color: #ede7f6; --md-navigation-tab-active-icon-color: #311b92; --md-navigation-tab-active-label-color: #311b92;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="12"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="1" aria-label="Tonal indicator" style="--md-navigation-tab-active-indicator-color: var(--md-sys-color-tertiary-container); --md-navigation-tab-active-icon-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-label-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-indicator-shape: 8px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Big glyphs" style="--md-navigation-tab-icon-size: 30px; --md-navigation-tab-active-indicator-width: 72px; --md-navigation-tab-label-font-weight: 700; --md-navigation-tab-label-font-size: 13px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Branded badge" style="--md-navigation-tab-badge-color: #7c4dff; --md-navigation-tab-badge-on-color: #ffffff; --md-navigation-tab-active-indicator-color: #ede7f6; --md-navigation-tab-active-icon-color: #311b92; --md-navigation-tab-active-label-color: #311b92;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="12"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<div style="display:grid;gap:20px;inline-size:100%;max-inline-size:420px;">
<md-navigation-bar active-index="1" aria-label="Tonal indicator" style="--md-navigation-tab-active-indicator-color: var(--md-sys-color-tertiary-container); --md-navigation-tab-active-icon-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-label-color: var(--md-sys-color-on-tertiary-container); --md-navigation-tab-active-indicator-shape: 8px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Big glyphs" style="--md-navigation-tab-icon-size: 30px; --md-navigation-tab-active-indicator-width: 72px; --md-navigation-tab-label-font-weight: 700; --md-navigation-tab-label-font-size: 13px;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
<md-navigation-bar active-index="1" aria-label="Branded badge" style="--md-navigation-tab-badge-color: #7c4dff; --md-navigation-tab-badge-on-color: #ffffff; --md-navigation-tab-active-indicator-color: #ede7f6; --md-navigation-tab-active-icon-color: #311b92; --md-navigation-tab-active-label-color: #311b92;">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="12"></md-navigation-tab>
<md-navigation-tab label="Profile" icon="person"></md-navigation-tab>
</md-navigation-bar>
</div>The bar exposes one part; each destination exposes seven.
| Part | On | Element |
|---|---|---|
container | md-navigation-bar | The inner tablist row |
container | md-navigation-tab | The destination’s own box |
indicator | md-navigation-tab | The active pill |
icon-container | md-navigation-tab | Wrapper holding glyph + badge |
icon | md-navigation-tab | The glyph |
badge | md-navigation-tab | The badge |
label | md-navigation-tab | The label text |
state-layer | md-navigation-tab | Hover / focus / press overlay |
<!-- index.html <head> — the icon font the components draw from -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap">
<!-- index.html — register the AWC UI elements once -->
<script type="module">
import '@awc-ui/core/define';
</script>
<style>
.parts-nav::part(container) { padding-inline: 8px; }
.parts-nav md-navigation-tab::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.parts-nav md-navigation-tab::part(indicator) { border-radius: 6px; }
.parts-nav md-navigation-tab::part(badge) { outline: 2px solid var(--md-sys-color-surface-container); }
</style>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar class="parts-nav" active-index="1" aria-label="Styled parts">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>// Icons need the Material Symbols stylesheet in index.html — see Installation.
import { MdNavigationBar, MdNavigationTab } from '@awc-ui/react';
export function Demo() {
return (
<>
<style>
.parts-nav::part(container) { padding-inline: 8px; }
.parts-nav md-navigation-tab::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.parts-nav md-navigation-tab::part(indicator) { border-radius: 6px; }
.parts-nav md-navigation-tab::part(badge) { outline: 2px solid var(--md-sys-color-surface-container); }
</style>
<div style={{ inlineSize: '100%', maxInlineSize: '420px' }}>
<MdNavigationBar className="parts-nav" activeIndex="1" aria-label="Styled parts">
<MdNavigationTab label="Home" icon="home" activeIcon="home"></MdNavigationTab>
<MdNavigationTab label="Search" icon="search"></MdNavigationTab>
<MdNavigationTab label="Messages" icon="chat" badgeValue="3"></MdNavigationTab>
</MdNavigationBar>
</div>
</>
);
}// Icons need the Material Symbols stylesheet in index.html — see Installation.
// app.module.ts — register the AWC UI elements once
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AwcUiModule } from '@awc-ui/angular';
@NgModule({
imports: [AwcUiModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}
<!-- app.component.html -->
<style>
.parts-nav::part(container) { padding-inline: 8px; }
.parts-nav md-navigation-tab::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.parts-nav md-navigation-tab::part(indicator) { border-radius: 6px; }
.parts-nav md-navigation-tab::part(badge) { outline: 2px solid var(--md-sys-color-surface-container); }
</style>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar class="parts-nav" active-index="1" aria-label="Styled parts">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div><script setup>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<template>
<style>
.parts-nav::part(container) { padding-inline: 8px; }
.parts-nav md-navigation-tab::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.parts-nav md-navigation-tab::part(indicator) { border-radius: 6px; }
.parts-nav md-navigation-tab::part(badge) { outline: 2px solid var(--md-sys-color-surface-container); }
</style>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar class="parts-nav" active-index="1" aria-label="Styled parts">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>
</template><script>
// Icons need the Material Symbols stylesheet in index.html — see Installation.
import '@awc-ui/core/define';
</script>
<style>
.parts-nav::part(container) { padding-inline: 8px; }
.parts-nav md-navigation-tab::part(label) { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.parts-nav md-navigation-tab::part(indicator) { border-radius: 6px; }
.parts-nav md-navigation-tab::part(badge) { outline: 2px solid var(--md-sys-color-surface-container); }
</style>
<div style="inline-size: 100%; max-inline-size: 420px;">
<md-navigation-bar class="parts-nav" active-index="1" aria-label="Styled parts">
<md-navigation-tab label="Home" icon="home" active-icon="home"></md-navigation-tab>
<md-navigation-tab label="Search" icon="search"></md-navigation-tab>
<md-navigation-tab label="Messages" icon="chat" badge-value="3"></md-navigation-tab>
</md-navigation-bar>
</div>The bar’s own part is reachable from the page stylesheet; the destinations’ parts are one level down, so select the tag first:
md-navigation-bar::part(container) { padding-inline: 8px;}
md-navigation-bar md-navigation-tab::part(indicator) { border-radius: 6px;}md-navigation-tab ·
md-navigation-rail ·
md-tabs ·
md-app-bar ·
md-fab ·
md-badge
md-navigation-barTwo artefacts to give your AI agent so it generates correct UI with this component. The per-component spec answers "how do I use this exact tag?". The main-llm spec answers "which tag should I pick in the first place?".
md-navigation-bar spec card
Identity · when to use / when NOT · decision cues · behavioural contract · do/don't · anti-patterns · full API. Paste into your agent when you're implementing with this component.
System-prompt preamble · decision matrix · token reference · page recipes · anti-patterns. Paste into the system prompt at the start of a piece of work.