Airframe GitHub Storybook
Component

ba-loading-skeleton

Use ba-loading-skeleton to show a loading animation on individual sections

Airframe

Active
Figma

Web Components

Active
Storybook Github

React

Active
Storybook Github

React Native

Planned
Design Code Accessibility QA
A

Image

Displays at the dimensions of the image about to load for example '16-9', or '1-1'

B

Text (example)

Shows that text will be loading in the space illustrated. This can be any combination of headings, paragraphs or links

C

Button

Indicates a button component will be loaded

Where possible use rem units when defining custom settings. This provides more flexibility and helps with making the bars in the component responsive.

If you do need to use px units make sure they are in multiples of 8. This is because the design system is built upon an 8px grid, so all properties should match this so that they visually align with the other design system elements.

Further reading:

ba-loading-skeleton behaves as a loader for small sections of content and does this in an accessible way.

Once the content has loaded in hide the section loader or remove it from the DOM. This will stop screen readers announcing the loading text within the component.

An example can be found on storybook

<ba-loading-skeleton
  settings="h1,p,p,p,p,ba-link,ba-button"
></ba-loading-skeleton>
Property Attribute Description Type Default
settings(required) settings A list of element tags, or a stringified list of loaderSettings. You must pick one or the other, they cannot be combined LoaderSettings[] | string undefined
  • None

No slotted content available for this component.

ba-loading-skeleton can be slotted into:

Add the section loader to a page
<ba-loading-skeleton
  settings="h1,p,p,p,p,ba-link,ba-button"
></ba-loading-skeleton>

When using multiple paragraph elements. The last paragraph in a set has a reduced width.

Add the section loader to a page
<ba-loading-skeleton
  settings="p,p,p,p"
></ba-loading-skeleton>

When needing to show an image section add the required aspect ratio with the ba-image tag

Using the loading-skeleton with images
<ba-loading-skeleton settings="ba-image-16-9"></ba-loading-skeleton>
<ba-loading-skeleton settings="ba-image-1-1"></ba-loading-skeleton>
For complex layouts a stringified list of loaderSettings can be used
<ba-loading-skeleton
  settings='[
    {
      "barHeight": "352px",
      "barWidth": "100%",
      "gapBeforeBar": "80px"
    },
    {
      "barHeight": "2rem",
      "barWidth": "40%",
      "gapBeforeBar": "0.5rem"
    },
    {
      "barHeight": "2rem",
      "barWidth": "50%",
      "gapBeforeBar": "0.5rem"
    },
    {
      "barHeight": "24px",
      "barWidth": "30%",
      "gapBeforeBar": "0.5rem"
    }
  ]'
></ba-loading-skeleton>
  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
  • p
  • ba-link
  • ba-link-back
  • ba-button
  • ba-image-1-1
  • ba-image-16-9
  • ba-image-9-16
  • ba-image-4-3
  • ba-image-3-4
  • ba-image-credit-card
Prop Description Type Default
settings (required) A list of element tags, or a stringified list of loaderSettings. You must pick one or the other, they cannot be combined LoaderSettings[] | string undefined

None

BaLoadingSkeleton can be slotted into:

Add the section loader to a page
<BaLoadingSkeleton
  settings="h1,p,p,p,p,ba-link,ba-button"
/>

When using multiple paragraph elements. The last paragraph in a set has a reduced width.

Add the section loader to a page
<BaLoadingSkeleton
  settings="p,p,p,p"
/>

When needing to show an image section add the required aspect ratio with the ba-image tag

Using the loading skeleton with images
<>
  <BaLoadingSkeleton settings="ba-image-16-9" />
  <BaLoadingSkeleton settings="ba-image-1-1" />
</>
For complex layouts a stringified list of loaderSettings can be used
<BaLoadingSkeleton
  settings={[
    {
      "barHeight": "352px",
      "barWidth": "100%",
      "gapBeforeBar": "80px"
    },
    {
      "barHeight": "2rem",
      "barWidth": "40%",
      "gapBeforeBar": "0.5rem"
    },
    {
      "barHeight": "2rem",
      "barWidth": "50%",
      "gapBeforeBar": "0.5rem"
    },
    {
      "barHeight": "24px",
      "barWidth": "30%",
      "gapBeforeBar": "0.5rem"
    }
  ]}
/>
  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
  • p
  • ba-link
  • ba-link-back
  • ba-button
  • ba-image-1-1
  • ba-image-16-9
  • ba-image-9-16
  • ba-image-4-3
  • ba-image-3-4
  • ba-image-credit-card

React Native documentation coming soon.

For uses that prefer reduced motion, the animation is completely disabled.

Some users experience distraction or nausea from animated content. For example, if scrolling a page causes elements to move (other than the essential movement associated with scrolling) it can trigger vestibular disorders.

The animation stops animating after 5 seconds to comply with WCAG Success Criterion 2.2.2

Further Reading:

Each bar in the section loader has the aria="hidden" attribute set. This is because the bars are just decorative.

Instead a visually hidden span with the text loading is available, so screen readers can inform the user.

Currently the colours used in the section loader do no meet the WCAG color contrast specifications.

This will be fixed in a later release.

No keyboard interactions have been defined for this component.

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

  • ba-loading-skeleton matches the width of preceding elements (header or paragraph) following layout rules
  • On mobile, ba-loading-skeleton extends to the full width of the screen
  • On desktop, ba-loading-skeleton is never smaller than 3 columns
  • ba-loading-skeleton is only used for optional information, not content required by every user
  • barWidth should only be able to go to 100%
  • barHeight should be able to expand with no limits
  • Loading text is read out for screen reader users in correct language

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

  • ba-loading-skeleton has loading text for screen readers
  • Is operable using assistive technology
  • Colour contrast for all states in all BAgel themes
  • Animations respect users' reduced motion settings
Designing Developing Components BAgel helper QA process britishairways.com Careers Cookie policy