Search the documentation

Type to search page titles, component names and descriptions.

    Feedback

    Spinner and Skeleton

    An unknown wait, without layout shift.

    import { Spinner, Skeleton } from 'faifo-design'

    Spinner marks a short wait inside a control or a region. Skeleton holds the shape of content that is being read, so the layout does not move when it arrives.

    #When to use

    • Use a Skeleton for a region whose shape is known; use a Spinner for a small, short wait.
    • A button that is working uses its own loading state.

    #Examples

    Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.

    #Transient feedback and loading

    Live-region toasts (one reporting background work with progress), compact progress and content skeletons share state rules.

    Saving recordSaving record
    Record saved

    All changes are synchronized.

    Importing products

    products-october.csv · Started by Linh

    180 of 450 rows40%
    Show codeHide code
    import { Inline, Skeleton, Spinner, Stack, ToastRegion } from 'faifo-design'
    
    export const Example = () => (
      <Stack
        items={[
          <Inline items={[<Spinner label="Saving record" />, <span>Saving record</span>]} />,
          <Skeleton label="Loading customer summary" lines={3} />,
          <ToastRegion
            label="Notifications"
            toasts={[
              {
                id: 'saved',
                title: 'Record saved',
                message: 'All changes are synchronized.',
                tone: 'positive',
              },
              {
                id: 'importing',
                title: 'Importing products',
                message: 'products-october.csv · Started by Linh',
                tone: 'info',
                progress: { value: 40, label: '180 of 450 rows' },
              },
            ]}
          />,
        ]}
      />
    )

    #API

    Generated from the package source. A property without a description has none in the source yet.

    #SpinnerComponent

    PropertyDescriptionTypeDefault
    labelrequired–string–
    size–'small' | 'default' | 'large''default'
    decorative–boolean–

    #SkeletonComponent

    PropertyDescriptionTypeDefault
    labelrequired–string–
    lines–number3
    decorative–boolean–

    #Hooks

    The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.

    • spinner
    • visually-hidden
    • skeleton
    • skeleton-line