Canopy Filter Buttons — Best Practices

SkillDev tools

Best practices for Canopy Filter Buttons. Trigger when adding filter button controls for narrowing data sets, with single or multiple selection, 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 Filter Buttons — 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/forms-filter-buttons/SKILL.md and read by ahel’s review.

This skill provides usage guidance and dos and don'ts for Canopy filter buttons from @legal-and-general/canopy.

Apply this skill when building filter controls for data sets. Filter buttons are typically used inside a lg-filter-container — see also the filter-container skill.


Import

For single selection (select one):

import { LgRadioGroupComponent, LgRadioButtonComponent } from '@legal-and-general/canopy';

For multiple selection (select multiple):

import { LgCheckboxGroupComponent, LgToggleComponent } from '@legal-and-general/canopy';

Select One (Single Selection)

Style radio buttons as filter buttons to allow a single selection:

<lg-radio-group formControlName="status">
  Status
  <lg-radio-button value="all">All</lg-radio-button>
  <lg-radio-button value="active">Active</lg-radio-button>
  <lg-radio-button value="closed">Closed</lg-radio-button>
</lg-radio-group>

Select Multiple

Use checkbox group to allow multiple simultaneous selections:

<lg-checkbox-group formControlName="types">
  Document type
  <lg-toggle value="statements">Statements</lg-toggle>
  <lg-toggle value="letters">Letters</lg-toggle>
  <lg-toggle value="reports">Reports</lg-toggle>
</lg-checkbox-group>

Dos and Don'ts

Do

  1. Do use the deselected state as the default for all filter buttons.
  2. Do keep filter labels succinct.
  3. Do choose the correct button type — Select One when only one filter can be active, Select Multiple when several can.
  4. Do maintain 12 px horizontal space between buttons.

Don't

  1. Don't use filter buttons for more than 10 filter options — use radio buttons or checkboxes in a filter panel instead.
  2. Don't centre or right-align the filter buttons.
  3. Don't mix 'Select one' and 'Select multiple' filters in the same group.

Inputs

Select One — LgRadioGroupComponent

InputTypeDefaultRequiredDescription
idstringauto-generatedNoHTML id attribute.
namestringauto-generatedNoSets name on all buttons in the group.
valueboolean | stringnullNoDefault selected value.
focusbooleannullNoSets focus on the fieldset.

Select One — LgRadioButtonComponent

InputTypeDefaultRequiredDescription
idstringauto-generatedNoHTML id attribute.
namestringnullYesHTML name attribute.
valuestringnullYesHTML value attribute.
ariaDescribedBystringnullNoID of the element that describes the radio button.

Select Multiple — LgCheckboxGroupComponent

InputTypeDefaultRequiredDescription
idstringauto-generatedNoHTML id attribute.
namestringauto-generatedNoSets name on all toggles in the group.
valueArray<string>nullNoDefault checked values.
focusbooleannullNoSets focus on the fieldset.
disabledbooleanfalseNoDisables all inner filter buttons.
ariaDescribedBystringnullNoID of the element that describes the group.

Select Multiple — LgToggleComponent

InputTypeDefaultRequiredDescription
idstringauto-generatedNoHTML id attribute.
namestringauto-generatedNoHTML name attribute.
valuestringnullYesHTML value attribute.
checkedbooleanfalseNoDefault checked state.

Signals

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