Android — Material 3 JS behaviour

Search bar & view

The M3 search bar that grows into a full-screen search view on touch: recent suggestions, filter chips and live results; back exits through the system arrow.

Documentation

Real scenarios

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

The bar becomes the view

Tap the resting bar — the whole screen becomes the search view with your recents, three filter chips and results that thin out as you type. Write «دل» or «چای» and watch. The system arrow takes you back.

Nabu library

What do you want to hear tonight?
Made for tonight

The resting bar is 56 px with the tinted mic and your avatar; the view keeps the 32 px chips and lists everything the library really has.

Important props

Important props
Prop Type Default What it does
resting height '56px' The resting bar height, fully rounded, with an avatar and a mic.
expanded state 'full-screen' The expanded view takes the whole screen; sections cascade in.
leading · trailing slots 'search · voice' A leading search icon, a trailing tinted voice icon.

Snippet

<button class="m3srch-bar" aria-label="جست‌وجو">
    <svg>🔍</svg> <span>چه چیزی می‌خواهید بشنوید؟</span>
    <img class="m3srch-avatar" src="…" alt="">
</button>

<style>
.m3srch-bar { display: flex; align-items: center; gap: 12px; inline-size: 100%;
              block-size: 56px; padding-inline: 16px; border-radius: 999px;
              background: #ECE6F0; }
.m3srch-avatar { margin-inline-start: auto; inline-size: 32px; border-radius: 50%; }
</style>