Skip to main content
Fallback
@coinbase/cds-web@8.56.1
A component that displays a fallback animation.
import { Fallback } from '@coinbase/cds-web/layout/Fallback'
Related components

Basic example

Loading...

Shape

The shape of the fallback can further be customized with the shape prop.

Loading...

Rectangular fallback width

If the fallback shape is a rectangle and the width is specified as a number, then by default, the width value will be recalculated and randomized within a predetermined threshold (e.g. to add some variety when multiple fallbacks are presented together). If this behavior is undesirable (e.g. in server-side rendered web apps), randomization can be disabled with the disableRandomRectWidth prop.

Alternatively, you may create a rectangle width variant by setting a number value on the rectWidthVariant prop. Variants map to a predetermined set of width values, which are cycled through repeatedly when the set is exhausted. Therefore, it's still possible to achieve some variety, but in a deterministic manner (i.e. safe for server-side rendering).

Loading...

Accessibility

Fallback has an accessibilityLabel prop to describe the loading state for assistive technologies. Wrap Fallback in a live region container to announce loading state changes.

Loading...

If you render multiple Fallbacks in an area, you may use aria-hidden prop on each Fallback to disable individual announcements from assistive technologies. If you choose to do so, please add your own label in the parent container to indicate the loading state for the entire area. While the label element can be visually hidden, it is still crucial to mark the container as a live region for the label to be announced when state changes.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.