PPolaris ComponentsConnect an agent

Skeleton page

A full-page loading shell with a placeholder title, back action and primary action, filled with skeleton cards until the real page is ready.

Preview

Code

Example.jsx
import { SkeletonPage, Layout, Card, Box, BlockStack, InlineStack, SkeletonBodyText, SkeletonDisplayText, SkeletonThumbnail, SkeletonTabs, Divider } from '@shopify/polaris';

const VARIANT_ROWS = ['small', 'medium', 'large'];

export const Example = () => (
  <SkeletonPage title="Aurora Wool Scarf" backAction primaryAction>
    <Layout>
      <Layout.Section>
        <BlockStack gap="400">
          <Card padding="0">
            <SkeletonTabs count={4} />
            <Box padding="400">
              <BlockStack gap="400">
                <SkeletonDisplayText size="small" />
                <SkeletonBodyText lines={3} />
              </BlockStack>
            </Box>
          </Card>

          <Card padding="0">
            <Box padding="400">
              <SkeletonDisplayText size="small" />
            </Box>
            <Divider />
            {VARIANT_ROWS.map((row, index) => (
              <BlockStack key={row} gap="0">
                {index > 0 && <Divider />}
                <Box padding="400">
                  <InlineStack gap="400" blockAlign="center" wrap={false}>
                    <SkeletonThumbnail size="small" />
                    <Box width="100%">
                      <SkeletonBodyText lines={2} />
                    </Box>
                  </InlineStack>
                </Box>
              </BlockStack>
            ))}
          </Card>
        </BlockStack>
      </Layout.Section>

      <Layout.Section variant="oneThird">
        <BlockStack gap="400">
          <Card>
            <BlockStack gap="300">
              <SkeletonDisplayText size="small" />
              <SkeletonBodyText lines={2} />
            </BlockStack>
          </Card>
          <Card>
            <BlockStack gap="300">
              <SkeletonDisplayText size="small" />
              <SkeletonBodyText lines={4} />
            </BlockStack>
          </Card>
        </BlockStack>
      </Layout.Section>
    </Layout>
  </SkeletonPage>
);