Navigation
Glass Tabs
A pill of tabs whose glass bubble springs over to the one you pick. Press and it lifts into a lens that magnifies the tabs and slides under your finger.
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 { GlassTabs, GlassTabsList, GlassTabsTrigger, GlassTabsContent } from 'ngx-vitreo';
@Component({
imports: [GlassTabs, GlassTabsList, GlassTabsTrigger, GlassTabsContent],
// ...
})Usage
Usage
<glass-tabs class="docs-glass-tabs" [value]="value()" (valueChange)="select($event)">
<glass-tabs-list class="docs-glass-tab-list" aria-label="Sections">
<button glassTabsTrigger value="overview">Overview</button>
<button glassTabsTrigger value="details">Details</button>
</glass-tabs-list>
<glass-tabs-content class="docs-glass-tab-panel" value="overview">
A glass lozenge slides to the selected tab.
</glass-tabs-content>
<glass-tabs-content class="docs-glass-tab-panel" value="details">
The arrow keys move between tabs.
</glass-tabs-content>
</glass-tabs>API reference
GlassTabs
glass-tabs
| Input | Type | Default | Description |
|---|---|---|---|
[(value)] / defaultValue | string | None | Controlled or uncontrolled selected tab, matching a trigger's value. |
(valueChange) | string | None | Emits the newly selected tab's value. |
orientation | 'horizontal' | 'vertical' | 'horizontal' | Sets which arrow keys move between triggers. |
activationMode | 'automatic' | 'manual' | 'automatic' | Automatic selects a tab as it gains focus; manual waits for Enter or Space. |
GlassTabsList
glass-tabs-list
| Input | Type | Default | Description |
|---|---|---|---|
class | string | None | Applies to the glass pill that holds the triggers and the moving indicator. |
GlassTabsTrigger
button[glassTabsTrigger]
| Input | Type | Default | Description |
|---|---|---|---|
value | string | None | Ties the trigger to the glass-tabs-content with the same value. Required. |
disabled | boolean | false | Skips the tab. |
GlassTabsContent
glass-tabs-content
| Input | Type | Default | Description |
|---|---|---|---|
value | string | None | Shown when the trigger with the same value is selected. Required. |
class | string | None | Applies to the glass card. |