Canopy Tabs — Best Practices

SkillDev tools

Best practices for the Canopy Tabs component. Trigger when switching between content sections, tabbed navigation, route-based tabs, or single-page tab interfaces in an Angular project using Canopy.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Canopy Tabs — Best Practices skill

What this skill tells your AI

The instructions your AI receives, as published by legal-and-general/canopy in skills/best-practice/tabs/SKILL.md and read by ahel’s review.

This skill provides usage guidance and input reference for the Canopy tabs components from @legal-and-general/canopy.

Apply this skill whenever you use LgTabsComponent, LgTabItemComponent, LgTabNavBarComponent, or LgTabNavBarLinkDirective.


Import

import {
  LgTabsComponent,
  LgTabItemComponent,
  LgTabItemHeadingComponent,
  LgTabItemContentComponent,
} from '@legal-and-general/canopy';

For tabbed navigation (router-based):

import {
  LgTabNavBarComponent,
  LgTabNavBarLinkDirective,
  LgTabNavContentComponent,
} from '@legal-and-general/canopy';

Tabbed Content

Use when displaying related content, one section at a time.

<lg-tabs label="Account sections" (tabEvent)="onTabChange($event)">
  <lg-tab-item>
    <lg-tab-item-heading>Overview</lg-tab-item-heading>
    <lg-tab-item-content>
      <div class="lg-tabs__content-section">
        <p>Overview content here.</p>
      </div>
    </lg-tab-item-content>
  </lg-tab-item>
  <lg-tab-item>
    <lg-tab-item-heading>Details</lg-tab-item-heading>
    <lg-tab-item-content>
      <div class="lg-tabs__content-section">
        <p>Details content here.</p>
      </div>
    </lg-tab-item-content>
  </lg-tab-item>
</lg-tabs>

Tabbed Navigation (Router-based)

Use when tabs correspond to distinct routes.

<lg-tab-nav-bar label="Section navigation">
  <a lgTabNavBarLink id="tab-1" [isActive]="true" routerLink="overview">Overview</a>
  <a lgTabNavBarLink id="tab-2" routerLink="details">Details</a>
</lg-tab-nav-bar>
<lg-tab-nav-content [selectedTabId]="'tab-1'">
  <router-outlet></router-outlet>
</lg-tab-nav-content>

Inputs

LgTabsComponent

InputTypeDefaultRequiredDescription
labelstring'tabs'YesAccessible label for the tab list.

LgTabsComponent Outputs

OutputTypeDescription
tabEventEventEmitter<{ index: number }>Emitted when the selected tab changes.

LgTabNavBarComponent

InputTypeDefaultRequiredDescription
labelstring'Tabs'NoAccessible label for the navigation tab list.

LgTabNavBarLinkDirective

InputTypeDefaultDescription
isActivebooleanfalseSets the active state.
isFocusedbooleanfalseSets the focus state.
indexnumber0Tab index position in the list.

When to Use vs Alternatives

  • Use Tabs when users need to switch between sections and all sections are equally important.
  • Use Accordion when content sections can be hidden to save space but are not equally prominent.
  • Tabs are pending brand modernisation.

Signals

GitHub stars
23
Forks
46
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
canopy-tabs
Source
github.com/legal-and-general/canopy