Navigation
Glass Bottom Bar
The bar at the bottom of an iOS app in one element: tabs from your data, a press lens and a search that opens beside them. Turn each part on or off.
Preview
Installation
Install the package once, then import the parts you use into a standalone component.
Install
npm install ngx-vitreo @angular/cdk @floating-ui/domImport
import { GlassBottomBar, GlassBottomBarIcon } from 'ngx-vitreo';
@Component({
imports: [GlassBottomBar, GlassBottomBarIcon],
// ...
})Usage
Usage
<glass-bottom-bar
navigationLabel="Music"
searchPlaceholder="Artists, songs and more"
[items]="items"
[(value)]="tab"
[(query)]="query"
[search]="search()"
[labels]="labels()"
[lens]="lens()"
/>
<!-- items: GlassBottomBarItem[] -->
<!-- { value: 'home', label: 'Home', icon: 'M4.5 10.2 12 4l7.5 6.2V19…' } -->API reference
GlassBottomBar
glass-bottom-bar
| Input | Type | Default | Description |
|---|---|---|---|
items | GlassBottomBarItem[] | None | The tabs, in order: { value, label, icon?, disabled? }. icon is SVG path data on a 24 × 24 grid, drawn as a rounded stroke. Required. |
[(value)] | string | the first item | The selected tab's value. |
labels | boolean | true | Shows each label under its icon; off, the tabs are icons alone, named by their labels. |
lens | boolean | true | Lifts the selection into a lens that magnifies the tabs while pressed, and slides with the pointer. |
search | boolean | true | Shows the search button. Open, the tabs fold into a circle and the field grows out of the button. |
searchPlaceholder / searchLabel | string | 'Search' / 'Search' | The field's placeholder and the closed search button's accessible name. |
[(searchOpen)] / [(query)] | boolean / string | false / '' | Whether search is open, and its text. |
clearSearchOnClose | boolean | true | Clears the text when search closes, as cancelling a search does on iOS. |
(searchSubmitted) | string | None | Emits the text when Enter is pressed in the field. |
navigationLabel | string | 'Tabs' | The tab list's accessible name. |
GlassBottomBarIcon
ng-template[glassBottomBarIcon]
| Input | Type | Default | Description |
|---|---|---|---|
let-item / let-active | GlassBottomBarItem / boolean | None | Draws every tab's icon your own way, in place of icon path data. Make its root an <svg> or <img>. |