Sheet

A sheet is a large container that enters from the edge of the screen when triggered by the merchant. It’s used to provide merchants with actions and information contextual to the page. It doesn’t interrupt their flow like a modal.

Deprecated

The sheet component encourages designers to create a new layer on top of the page instead of improving the existing user interface. It also blocks other parts of the UI, forces users to switch context, and adds complexity to otherwise simple interactions.

Sheet component examples

Use as the default option for a sheet.

import {
  List,
  Button,
  Page,
  LegacyCard,
  Sheet,
  Scrollable,
  ChoiceList,
  Text,
} from '@shopify/polaris';
import {XIcon} from '@shopify/polaris-icons';
import {useState, useCallback} from 'react';

function SheetExample() {
  const [sheetActive, setSheetActive] = useState(true);

  const [salesChannels] = useState([
    {value: 'onlineStore', label: 'Online Store'},
    {value: 'facebook', label: 'Facebook'},
    {value: 'googleShopping', label: 'Google shopping'},
    {value: 'facebookMarketing', label: 'Facebook Marketing'},
  ]);
  const [selected, setSelected] = useState<string[]>([]);

  const toggleSheetActive = useCallback(
    () => setSheetActive((sheetActive) => !sheetActive),
    [],
  );
  const handleSelectedChange = useCallback(
    (value: string[]) => setSelected(value),
    [],
  );

  let selectedSalesChannels: {value: string; label: string}[] = [];
  selected.forEach((selection) => {
    salesChannels.forEach((channel) => {
      if (channel.value === selection) {
        selectedSalesChannels.push(channel);
      }
    });
  });

  const hasSelectedSalesChannels = selectedSalesChannels.length > 0;

  const salesChannelsCardMarkup = hasSelectedSalesChannels ? (
    <List>
      {selectedSalesChannels.map((channel, index) => (
        <List.Item key={index}>{channel.label}</List.Item>
      ))}
    </List>
  ) : (
    <div
      style={{
        alignItems: 'center',
        display: 'flex',
        justifyContent: 'space-between',
        width: '100%',
      }}
    >
      <p>No sales channels selected</p>
      <Button onClick={toggleSheetActive}>Manage sales channels</Button>
    </div>
  );

  const salesChannelAction = hasSelectedSalesChannels
    ? [
        {
          onAction: toggleSheetActive,
          content: 'Manage sales channels',
        },
      ]
    : undefined;

  return (
    <Page narrowWidth>
      <LegacyCard
        sectioned
        subdued
        title="Product availability"
        actions={salesChannelAction}
      >
        {salesChannelsCardMarkup}
      </LegacyCard>
      <Sheet
        open={sheetActive}
        onClose={toggleSheetActive}
        accessibilityLabel="Manage sales channels"
      >
        <div
          style={{
            display: 'flex',
            flexDirection: 'column',
            height: '100%',
          }}
        >
          <div
            style={{
              alignItems: 'center',
              borderBottom: '1px solid #DFE3E8',
              display: 'flex',
              justifyContent: 'space-between',
              padding: '1rem',
              width: '100%',
            }}
          >
            <Text variant="headingMd" as="h2">
              Manage sales channels
            </Text>
            <Button
              accessibilityLabel="Cancel"
              icon={XIcon}
              onClick={toggleSheetActive}
              variant="plain"
            />
          </div>
          <Scrollable style={{padding: '1rem', height: '100%'}}>
            <ChoiceList
              title="Select a sales channel"
              name="salesChannelsList"
              choices={salesChannels}
              selected={selected}
              titleHidden
              allowMultiple
              onChange={handleSelectedChange}
            />
          </Scrollable>
          <div
            style={{
              alignItems: 'center',
              borderTop: '1px solid #DFE3E8',
              display: 'flex',
              justifyContent: 'space-between',
              padding: '1rem',
              width: '100%',
            }}
          >
            <Button onClick={toggleSheetActive}>Cancel</Button>
            <Button variant="primary" onClick={toggleSheetActive}>
              Done
            </Button>
          </div>
        </div>
      </Sheet>
    </Page>
  );
}

Accessibility

Sheets provide an opportunity to let merchants dig into more detail on their current task, or access information for their current task in a different way. Although merchants may be able to see content in the sheet and the main page content at the same time, they should only be expected to interact with one or the other at any given time.

Keyboard support

  • Use the onClose prop so that the sheet can be closed with the esc key as well as with button-based controls
  • Use a button to open the sheet
  • When the sheet opens, focus moves to it so merchants who rely on the keyboard and screen readers can access it
  • Focus is kept in the sheet until it is dismissed
  • When the sheet closes, focus moves back to the button that launched it

Responsive behavior

At small screen sizes, the sheet component enters the page from the bottom of the screen. At larger screen sizes, the sheet component enters the page from the right side of the scren.


Best practices

The sheet component should:

  • Include a heading that summarizes the actions and information in the sheet, for example, More filters
  • Be openable through clear actions, like a link or button
  • Be close-able through clear actions, like Done, the [X] button, and the esc key
  • Include information and actions contextual to the current task
  • Not block merchants from completing their task, like a modal would
  • Not open from within another sheet (only one sheet can be open at a time)
  • Preserve its state—the settings and actions won’t reset when it’s closed

The sheet component is best used in cases where the merchant needs to see elements behind it, and for that reason it uses a transparent backdrop. The backdrop is a full screen overlay which closes its parent component when pressed.


  • To offer an action before merchants can go to the next step in the flow, use the modal component
  • To present a small amount of content or a menu of actions in a non-blocking overlay, use the popover component

    On this page