Airframe GitHub Storybook
Component

ba-page-segment

This component is used to group related content and provide structure to our pages

Airframe

Active
Figma

Web Components

Active
Storybook GitHub

React

Active
Storybook GitHub

React Native

Beta
GitHub
Design Code Accessibility QA
A

Padding and page margins

First page segment showing both top and bottom padding with page margins. This vertical spacing creates separation from surrounding content

B

Top padding of the following page segment

Second page segment with automatically removed top padding. When multiple segments with matching themes are stacked, the top padding is removed to prevent double spacing between them

This will help users understand that the content in a page segment belong together.

Further reading:

Over using the themes can result in a cluttered interface that creates visual complexity.

Further reading:

<ba-page-segment>
  <ba-content><p>Page segment with default theme</p></ba-content>
</ba-page-segment>
<ba-page-segment theme="blue-200">
  <ba-content><p>Page segment with blue-200 theme</p></ba-content>
</ba-page-segment>
<ba-page-segment theme="midnight-700">
  <ba-content><p>Page segment with midnight-700 theme</p></ba-content>
</ba-page-segment>
Property Attribute Description Type Default
removeBottomPadding remove-bottom-padding Removes the bottom padding from the page segment boolean | undefined false
removeTopPadding remove-top-padding Removes the top padding from the page segment boolean | undefined false
theme theme Sets the theme for the page segment "blue-200" | "executive-club-blue-tier" | "executive-club-bronze-tier" | "executive-club-gold-tier" | "executive-club-premier-tier" | "executive-club-silver-tier" | "midnight-500" | "midnight-700" | "sale" | "the-club-blue" | "the-club-bronze" | "the-club-gold" | "the-club-gold-guest-list" | "the-club-premier" | "the-club-silver" | undefined undefined
  • None
Slot Description Permitted elements
Unnamed slot Elements will render in the body of the component <article>, <aside>, <ba‑accordion>, <ba‑cabin‑class‑group>, <ba‑card>, <ba‑card‑promo>, <ba‑card‑segmented>, <ba‑carousel>, <ba‑chart‑price>, <ba‑content>, <ba‑copy‑to‑clipboard>, <ba‑details>, <ba‑download>, <ba‑entry>, <ba‑flex>, <ba‑flight‑line>, <ba‑flight‑number>, <ba‑form>, <ba‑grid>, <ba‑image>, <ba‑link>, <ba‑link‑back>, <ba‑link‑entry>, <ba‑link‑price>, <ba‑link‑tile>, <ba‑loading‑skeleton>, <ba‑logo>, <ba‑message>, <ba‑pagination>, <ba‑progress‑meter>, <ba‑seat‑map>, <ba‑star‑rating>, <ba‑tab‑chip‑content>, <ba‑tab‑chip‑group>, <ba‑tab‑container>, <ba‑table>, <ba‑toolbar>, <div>, <footer>, <form>, <section>

ba-page-segment can be slotted into:

In most scenarios ba-page-segment will be the first and only child of the <main> element.

Stacking multiple page-segments on a page
<main>
  <ba-page-segment> ... </ba-page-segment>
  <ba-page-segment> ... </ba-page-segment>
  <ba-page-segment> ... </ba-page-segment>
  <ba-page-segment> ... </ba-page-segment>
</main>

Sibling page ba-page-segment's with the same theme (either named or undefined) have the top padding removed

Stacking multiple themed page-segments on a page with notes on the padding applied by ba‑page‑segment
<main>
  <ba-page-segment>
    <!-- Has padding top and padding bottom -->
  </ba-page-segment>
  <ba-page-segment>
    <!-- Has only padding bottom -->
  </ba-page-segment>
  <ba-page-segment theme="sale">
    <!-- Has padding top and padding bottom -->
  </ba-page-segment>
  <ba-page-segment theme="sale">
    <!-- Has only padding bottom -->
  </ba-page-segment>
</main>

The top and bottom padding can be removed by using the following props remove-top-padding, remove-bottom-padding

Removing top and bottom padding
<main>
  <ba-page-segment remove-top-padding>
    <!-- Has no top padding -->
  </ba-page-segment>
  <ba-page-segment remove-bottom-padding>
    <!-- Has no bottom padding -->
  </ba-page-segment>
  <ba-page-segment remove-top-padding remove-bottom-padding>
    <!-- Has no top or bottom padding -->
  </ba-page-segment>
</main>
Prop Description Type Default
removeBottomPadding Removes the bottom padding from the page segment boolean | undefined false
removeTopPadding Removes the top padding from the page segment boolean | undefined false
theme Sets the theme for the page segment "blue-200" | "executive-club-blue-tier" | "executive-club-bronze-tier" | "executive-club-gold-tier" | "executive-club-premier-tier" | "executive-club-silver-tier" | "midnight-500" | "midnight-700" | "sale" | "the-club-blue" | "the-club-bronze" | "the-club-gold" | "the-club-gold-guest-list" | "the-club-premier" | "the-club-silver" | undefined undefined
children Elements will render in the body of the component <article>, <aside>, <ba‑accordion>, <ba‑cabin‑class‑group>, <ba‑card>, <ba‑card‑promo>, <ba‑card‑segmented>, <ba‑carousel>, <ba‑chart‑price>, <ba‑content>, <ba‑copy‑to‑clipboard>, <ba‑details>, <ba‑download>, <ba‑entry>, <ba‑flex>, <ba‑flight‑line>, <ba‑flight‑number>, <ba‑form>, <ba‑grid>, <ba‑image>, <ba‑link>, <ba‑link‑back>, <ba‑link‑entry>, <ba‑link‑price>, <ba‑link‑tile>, <ba‑loading‑skeleton>, <ba‑logo>, <ba‑message>, <ba‑pagination>, <ba‑progress‑meter>, <ba‑seat‑map>, <ba‑star‑rating>, <ba‑tab‑chip‑content>, <ba‑tab‑chip‑group>, <ba‑tab‑container>, <ba‑table>, <ba‑toolbar>, <div>, <footer>, <form>, <section>

None

BaPageSegment can be slotted into:

In most scenarios BaPageSegment will be the first and only child of the <main> element.

Stacking multiple PageSegments on a page
<main>
  <BaPageSegment> ... </BaPageSegment>
  <BaPageSegment> ... </BaPageSegment>
  <BaPageSegment> ... </BaPageSegment>
  <BaPageSegment> ... </BaPageSegment>
</main>

Sibling page BaPageSegment's with the same theme (either named or undefined) have the top padding removed

Stacking multiple themed page-segments on a page with notes on the padding applied by BaPageSegment
<main>
  <BaPageSegment>
    <!-- Has padding top and padding bottom -->
  </BaPageSegment>
  <BaPageSegment>
    <!-- Has only padding bottom -->
  </BaPageSegment>
  <BaPageSegment theme="sale">
    <!-- Has padding top and padding bottom -->
  </BaPageSegment>
  <BaPageSegment theme="sale">
    <!-- Has only padding bottom -->
  </BaPageSegment>
</main>

The top and bottom padding can be removed by using the following props removeTopPadding, removeBottomPadding

Removing top and bottom padding
<main>
  <BaPageSegment removeTopPadding>
    <!-- Has no top padding -->
  </BaPageSegment>
  <BaPageSegment removeBottomPadding>
    <!-- Has no bottom padding -->
  </BaPageSegment>
  <BaPageSegment removeTopPadding removeBottomPadding>
    <!-- Has no top or bottom padding -->
  </BaPageSegment>
</main>
Prop Description Type Default
children (required) ReactNode
theme Surface palette for this band. Omit to follow {@link BaModeProvider }.
With no provider, this is default. A set value replaces the mode theme
for this band and its descendants.
BaTheme
removeTopPadding boolean false
removeBottomPadding boolean false
removePageMargin Drop horizontal page-margin so full-bleed children (e.g. BaCarousel)
can overflow to the screen edge. Pair with a padded carousel track so the
first slide still lines up with neighbouring segments.
boolean false
fill boolean false
testID Used to locate this view in end-to-end tests. string
accessibilityLabel Overrides the text that's read by the screen reader when the user interacts with the element. By default, the
label is constructed by traversing all the children and accumulating all the Text nodes separated by space.
string
accessibilityHint An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label. string
accessibilityState Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element currently focused on. AccessibilityState

Put BaPageSegment in <BaScreen>. When the page scrolls, put it inside <BaScroll>.

Put copy and controls in <BaContent>. The mode theme comes from <BaModeProvider>.

In most scenarios BaPageSegment will be the first and only child of <BaScreen>.

Stacking multiple PageSegments on a page
<BaScreen>
  <BaPageSegment> ... </BaPageSegment>
  <BaPageSegment> ... </BaPageSegment>
  <BaPageSegment> ... </BaPageSegment>
  <BaPageSegment> ... </BaPageSegment>
</BaScreen>

Sibling BaPageSegments with the same theme (either named or omitted) have the top padding removed when they are wrapped in BaPageSegmentGroup. Without the group, each segment keeps its top padding.

In dark mode, an omitted segment is midnight-700. A neighbour with theme="default" is the white palette, so the group keeps the top padding on that neighbour.

Set removeTopPadding yourself and the group keeps your value. A child that is not a segment ends that run, so the next segment keeps its top padding.

Stacking multiple themed page-segments on a page with notes on the padding applied by BaPageSegment
<BaPageSegmentGroup>
  <BaPageSegment>
    {/* Has padding top and padding bottom */}
  </BaPageSegment>
  <BaPageSegment>
    {/* Has only padding bottom */}
  </BaPageSegment>
  <BaPageSegment theme="sale">
    {/* Has padding top and padding bottom */}
  </BaPageSegment>
  <BaPageSegment theme="sale">
    {/* Has only padding bottom */}
  </BaPageSegment>
</BaPageSegmentGroup>
An omitted segment beside theme default
<BaPageSegmentGroup>
  <BaPageSegment>
    {/* Follows the mode */}
  </BaPageSegment>
  <BaPageSegment theme="default">
    {/* White palette. Top padding stays in dark mode */}
  </BaPageSegment>
</BaPageSegmentGroup>

The top and bottom padding can be removed by using the following props removeTopPadding, removeBottomPadding.

Removing top and bottom padding
<BaScreen>
  <BaPageSegment removeTopPadding>
    {/* Has no top padding */}
  </BaPageSegment>
  <BaPageSegment removeBottomPadding>
    {/* Has no bottom padding */}
  </BaPageSegment>
  <BaPageSegment removeTopPadding removeBottomPadding>
    {/* Has no top or bottom padding */}
  </BaPageSegment>
</BaScreen>

Omit theme and the segment follows the colour mode. Light mode uses default. Dark mode uses midnight-700. Pass theme to keep the segment on one palette. theme="default" is the white palette in light and dark mode.

The screen theme paints the area around the segment. In the second figure the screen is sale and the segment omits theme, so the segment still follows the mode. Pass theme="sale" on the segment when it should be sale as well.

With no BaModeProvider, an omitted theme is default.

A segment that follows the mode
<BaScreen>
  <BaPageSegment>
    <BaContent>
      <BaText variant="body16">This segment follows the mode.</BaText>
    </BaContent>
  </BaPageSegment>
</BaScreen>
A sale screen whose segment still follows the mode
<BaScreen theme="sale">
  <BaPageSegment>
    <BaContent>
      <BaText variant="body16">This segment follows the mode.</BaText>
    </BaContent>
  </BaPageSegment>
</BaScreen>

theme="sale" stays sale in light and dark mode. A cabin, sale, or club theme stays as you set it. BaText and BaButton inside the segment read that theme.

A sale segment that stays sale in both modes
<BaPageSegment theme="sale">
  <BaContent>
    <BaText variant="header20">Sale fares</BaText>
    <BaButton variant="primary" onPress={() => {}}>
      View fares
    </BaButton>
  </BaContent>
</BaPageSegment>

Set removePageMargin to drop the horizontal page margin. Use it for a full-bleed child, such as BaCarousel. Keep padding on the carousel track so the first slide still lines up with neighbouring segments.

A segment with the page margin removed
<BaPageSegment removePageMargin>
  <BaText variant="body16">Full-bleed content</BaText>
</BaPageSegment>

Set fill when the segment should take the remaining height of the screen. On a scrolling page, set fill on <BaScroll> as well.

A segment that fills the screen
<BaPageSegment fill>
  <BaContent>
    <BaText variant="header28">Hello</BaText>
  </BaContent>
</BaPageSegment>

Use appropriate heading levels, landmarks, and semantic HTML within ba-page-segment to maintain document hierarchy and screen reader navigation.

No keyboard interactions have been defined for this component.

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

  • ba-page-segment is used to group related content and provide visual structure to pages
  • Use themes to visually group related items on a page, helping users understand that content belongs together
  • Avoid over-using themed segments on a single page, as this creates visual complexity and clutter
  • Test with dynamic data to ensure proper spacing and padding in different scenarios
  • Sibling page segments with the same theme have top padding removed - i.e. there is not double padding between segments with the same theme
  • ba-page-segment does not interfere with page navigation or screen reader flow
  • Content within ba-page-segment follows proper semantic structure

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

  • ba-page-segment renders correctly in all BAgel themes
  • Colour contrast for all child bagel components meets WCAG standards
  • Adjacent segments with matching themes correctly remove duplicate top padding
  • High contrast mode unaffected by themes
Designing Developing Components BAgel helper Web QA React Native QA britishairways.com Careers Cookie policy