PPolaris ComponentsConnect an agent

CalloutCard

A card with an illustration that promotes one clear next step, such as finishing setup or upgrading a plan.

Preview

Code

Example.jsx
import { useState } from 'react';
import { CalloutCard, BlockStack, Text } from '@shopify/polaris';

const ILLUSTRATION = 'https://cdn.shopify.com/s/assets/admin/checkout/settings-customizecart-705f57c725ac05be5a34ec20c05b94298cb8afd10aac7bd9c7ad02030f48cfa0.svg';

export const Example = () => {
  const [dismissed, setDismissed] = useState(false);

  return (
    <BlockStack gap="400">
      <CalloutCard
        title="Customize the style of your checkout"
        illustration={ILLUSTRATION}
        primaryAction={{ content: 'Customize checkout', onAction: () => {} }}
        secondaryAction={{ content: 'Learn more', onAction: () => {} }}
      >
        <p>Upload your store's logo, change colors and fonts, and more.</p>
      </CalloutCard>

      {dismissed ? (
        <Text as="p" tone="subdued">
          The dismissible callout was closed.
        </Text>
      ) : (
        <CalloutCard
          title="Add a product to get started"
          illustration={ILLUSTRATION}
          primaryAction={{ content: 'Add product', onAction: () => {} }}
          onDismiss={() => setDismissed(true)}
        >
          <p>Products you add show up in your online store and can be added to discounts.</p>
        </CalloutCard>
      )}
    </BlockStack>
  );
};