Airframe GitHub Storybook
Component

ba-filter-checkbox

A checkbox filter component

Airframe

Active
Figma

Web Components

Active
GitHub

React

Planned

React Native

Planned

Must be used with ba-filter

This component should not be used on its own. Always use it within ba-filter to ensure correct spacing and layout

ba-filter
Design Code Accessibility QA
A

Parent filter toggle

The ba-filter toggle button, shown here for context, displaying the filter's label and the number of currently selected checkboxes

B

Checkbox option

Each ba-filter-checkbox displays a checkbox input and its label, and updates the selected count when toggled

C

Reset filter

The reset button, provided by the parent ba-filter, that clears all selected checkboxes

This component is for when one, none, or multiple options can be selected. If only one item at a time can be selected, use ba-filter-radio instead.

<ba-toolbar>
  <ba-filter label="Outbound airport" slot="filters">
    <ba-filter-checkbox name="londonHeathrow" label="London Heathrow (LHR)" value="1"></ba-filter-checkbox>
    <ba-filter-checkbox name="londonGatwick" label="London Gatwick (LGW)" value="2"></ba-filter-checkbox>
  </ba-filter>
</ba-toolbar>
Property Attribute Description Type Default
checked checked Whether the filter-checkbox is checked boolean | undefined undefined
label(required) label The label of the filter-checkbox string undefined
name(required) name The name of the filter string undefined
value(required) value The value of the filter-checkbox string undefined
  • None
Slot Description Permitted elements
Unnamed slot Elements will render in the body of the component <ba‑star‑rating>

ba-filter-checkbox can be slotted into:

Method Description Type
reset() => Promise<void> Resets the checkbox to its initial state. Promise<void>

ba-filter-checkbox should always be used within ba-filter to ensure correct spacing and layout.

Use two or more ba-filter-checkbox elements within a ba-filter to allow more than one option to be selected.

A filter with two checkbox options
<ba-toolbar>
  <ba-filter label="Outbound airport" slot="filters">
    <ba-filter-checkbox name="londonHeathrow" label="London Heathrow (LHR)" value="1"></ba-filter-checkbox>
    <ba-filter-checkbox name="londonGatwick" label="London Gatwick (LGW)" value="2"></ba-filter-checkbox>
  </ba-filter>
</ba-toolbar>

React documentation coming soon.

React Native documentation coming soon.

Always use the label attribute to give a meaningful label to the field.

Further reading:

State: Previous element in DOM has focus

⇥ Tab

<ba-filter-checkbox> gets focus

State: <ba-filter-checkbox> has focus

␣ Space

Toggles the checked state and updates the parent ba-filter's selected count

⇥ Tab

Next tabbable element in the DOM gets focus

Use this checklist to confirm the component has been configured and used correctly.

  • ba-filter-checkbox is always used within ba-filter
  • Use ba-filter-checkbox when one, none, or multiple options can be selected from the group
  • Use ba-filter-radio instead when only one option can be selected from the group
  • Label text is clear, concise, and helps users make an informed choice
  • A visible label is always provided
  • ba-filter-checkbox is operable with keyboard using tab to focus and space to toggle
  • Focus indicator has not been obscured on all sides of the component

These checks are handled by the component and do not need to be repeated each time it is used.

  • ba-filter-checkbox is operable using assistive technology
  • Checked state is available to assistive technology
  • Has a visible focus indicator on all sides of the component
  • Colour contrast for all states in all BAgel themes
  • Animations respect users' reduced motion settings
  • High contrast mode adjustments
Designing Developing Components BAgel helper QA process britishairways.com Careers Cookie policy