BrowseTabs

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

A glass lozenge slides to the selected tab.

Installation

Install the package once, then import the parts you use into a standalone component.

Install

npm install ngx-vitreo @angular/cdk @floating-ui/dom
Import

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

InputTypeDefaultDescription
[(value)] / defaultValuestringNoneControlled or uncontrolled selected tab, matching a trigger's value.
(valueChange)stringNoneEmits 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

InputTypeDefaultDescription
classstringNoneApplies to the glass pill that holds the triggers and the moving indicator.

GlassTabsTrigger

button[glassTabsTrigger]

InputTypeDefaultDescription
valuestringNoneTies the trigger to the glass-tabs-content with the same value. Required.
disabledbooleanfalseSkips the tab.

GlassTabsContent

glass-tabs-content

InputTypeDefaultDescription
valuestringNoneShown when the trigger with the same value is selected. Required.
classstringNoneApplies to the glass card.