## Feature Examples

### Structure
- description: Side panels are composed of up to four compound components: - `<SidePanel.Header/>` - `<SidePanel.Content/>` - `<SidePanel.Divider/>` - `<SidePanel.Footer/>` All of these components are optional.
- example:
```jsx
<SidePanel onCloseButtonClick={() => {}}>
  <SidePanel.Header title="Header" />
  <SidePanel.Content>
    <StorybookComponents.Placeholder height="480px">
      Content
    </StorybookComponents.Placeholder>
  </SidePanel.Content>
  <SidePanel.Footer>
    <StorybookComponents.Placeholder height="36px">
      Footer
    </StorybookComponents.Placeholder>
  </SidePanel.Footer>
</SidePanel>;
```

### Skin
- description: Control the component style with `skin` prop: - `standard` is the default style used in all common cases. - `floating` is used for settings panels that float on top of content in editor platforms ([Wix](https://www.wix.com/) or [Wix Studio](https://www.wix.com/studio)).
- example:
```jsx
<StorybookComponents.Stack>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="Standard" />
    <SidePanel.Content>
      <StorybookComponents.Stack height="480px" />
    </SidePanel.Content>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}} skin="floating" width="288px">
    <SidePanel.Header title="Floating" />
    <SidePanel.Content>
      <StorybookComponents.Stack height="492px" />
    </SidePanel.Content>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Width
- description: Set the side panel's width using the `width` property. The default width is 420px.
- example:
```jsx
<StorybookComponents.Stack>
  <SidePanel onCloseButtonClick={() => {}} width="300px">
    <SidePanel.Header title="Narrow panel" />
    <SidePanel.Content>
      <StorybookComponents.Stack height="360px" />
    </SidePanel.Content>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}} width="600px">
    <SidePanel.Header title="Wide panel" />
    <SidePanel.Content>
      <StorybookComponents.Stack height="360px" />
    </SidePanel.Content>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Height
- description: By default, panel height depends on the amount of content it contains. To define the maximum height it can grow to use `maxHeight` property. Fix the panel height to a specific number with `height` property.
- example:
```jsx
<StorybookComponents.Stack>
  <SidePanel onCloseButtonClick={() => {}} maxHeight="480px">
    <SidePanel.Header title="No height set" />
    <SidePanel.Content>
      <StorybookComponents.Placeholder height="40px" />
    </SidePanel.Content>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}} height="480px">
    <SidePanel.Header title="Fixed height set" />
    <SidePanel.Content>
      <StorybookComponents.Placeholder height="40px" />
    </SidePanel.Content>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Padding
- description: Content padding is enabled in the side panel by default, but can be disabled with the `noPadding` property for: - `<SidePanel.Header/>` - `<SidePanel.Content/>` - `<SidePanel.Footer/>` The padding can be removed to display lists or other components with built-in padding.
- example:
```jsx
<StorybookComponents.Stack>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="With padding" />
    <SidePanel.Content>
      <StorybookComponents.Placeholder height="360px" />
    </SidePanel.Content>
    <SidePanel.Footer>
      <StorybookComponents.Placeholder height="42px" />
    </SidePanel.Footer>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="No padding" noPadding={true} />
    <SidePanel.Content noPadding={true}>
      <StorybookComponents.Placeholder height="360px" />
    </SidePanel.Content>
    <SidePanel.Footer noPadding={true}>
      <StorybookComponents.Placeholder height="42px" />
    </SidePanel.Footer>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Dividers
- description: Dividers are enabled in the side panel by default but can be disabled using the `showDivider` property for: - `<SidePanel.Header/>` - `<SidePanel.Footer/>` Always show dividers in the side panel if users have the option to scroll vertically inside the panel.
- example:
```jsx
<StorybookComponents.Stack>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="With divider" />
    <SidePanel.Content>
      <StorybookComponents.Stack height="360px" />
    </SidePanel.Content>
    <SidePanel.Footer>
      <StorybookComponents.Stack height="42px" />
    </SidePanel.Footer>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="No divider" showDivider={false} />
    <SidePanel.Content>
      <StorybookComponents.Stack height="360px" />
    </SidePanel.Content>
    <SidePanel.Footer showDivider={false}>
      <StorybookComponents.Stack height="42px" />
    </SidePanel.Footer>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Header
- description: Customize the side panel's header using these properties: - `title` - `subtitle`
- example:
```jsx
<StorybookComponents.Stack flexDirection="column">
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="Title" showDivider={true} />
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="Title" subtitle="Subtitle" showDivider={true} />
  </SidePanel>
</StorybookComponents.Stack>;
```

### Header Actions
- description: Header has these properties for actions available: - `infoTooltipContent` - provides additional details or an explanation in a tooltip - `onHelpButtonClick`- allows users to access help articles and contextual information - `onBackButtonClick`- allows users to navigate back in the Side Panel - `backButtonDescription` - sets content of the back button's tooltip
- example:
```jsx
<StorybookComponents.Stack flexDirection="column">
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header
      title="Title"
      subtitle="Subtitle"
      infoTooltipContent="Additional info here"
      showDivider={true}
    />
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}} onHelpButtonClick={() => {}}>
    <SidePanel.Header title="Title" subtitle="Subtitle" showDivider={true} />
  </SidePanel>
  <SidePanel
    onCloseButtonClick={() => {}}
    onBackButtonClick={() => {}}
    backButtonDescription="Back"
  >
    <SidePanel.Header title="Title" subtitle="Subtitle" showDivider={true} />
  </SidePanel>
</StorybookComponents.Stack>;
```

### Custom header
- description: Create a custom header layout by adding children elements to the `<SidePanel.Header/>` container.
- example:
```jsx
<StorybookComponents.Stack flexDirection="column">
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="Title">
      <StorybookComponents.Stack margin="0px 24px 12px 24px">
        <StorybookComponents.Placeholder height="42px" />
      </StorybookComponents.Stack>
    </SidePanel.Header>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="Title" showDivider={false}>
      <Tabs
        items={[
          { id: 1, title: 'First Tab' },
          { id: 2, title: 'Second Tab' },
        ]}
        activeId={1}
        type="uniformSide"
        width="174px"
      />
    </SidePanel.Header>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="Title">
      <StorybookComponents.Stack margin="0px 24px 12px 24px">
        <Search />
      </StorybookComponents.Stack>
    </SidePanel.Header>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Text overflow
- description: Panel title and subtitle wraps to multiple lines by default. Limit the amount of lines using `ellipsis` and `maxLines` properties. Ellipsis do not apply to the subtitle, as its main purpose is to provide more information.
- example:
```jsx
<StorybookComponents.Stack flexDirection="column">
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header
      title="A long title that needs to wrap into multiple lines"
      subtitle="A long subtitle that needs to wrap into multiple lines because it is so long."
      showDivider={true}
    />
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header
      ellipsis
      maxLines={1}
      title="A long title that needs to wrap into multiple lines"
      subtitle="A long subtitle that needs to wrap into multiple lines because it is so long."
      showDivider={true}
    />
  </SidePanel>
</StorybookComponents.Stack>;
```

### Content sections
- description: Create sections inside of a panel by adding multiple `<SidePanel.Content/>` areas. Separate them from one another with a dedicated `<SidePanel.Divider/>` element.
- example:
```jsx
<SidePanel onCloseButtonClick={() => {}}>
  <SidePanel.Header title="Content sections" />
  <SidePanel.Content>
    <StorybookComponents.Stack height="150px" />
  </SidePanel.Content>
  <SidePanel.Divider />
  <SidePanel.Content>
    <StorybookComponents.Stack height="150px" />
  </SidePanel.Content>
  <SidePanel.Divider />
  <SidePanel.Content>
    <StorybookComponents.Stack height="150px" />
  </SidePanel.Content>
</SidePanel>;
```

### Content fields
- description: Separate controls inside of a panel from one another by wrapping each one into `<SidePanel.Field/>` container.
- example:
```jsx
<StorybookComponents.Stack>
  <SidePanel onCloseButtonClick={() => {}}>
    <SidePanel.Header title="Content fields" />
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
  </SidePanel>
  <SidePanel onCloseButtonClick={() => {}} skin="floating" width="288px">
    <SidePanel.Header title="Content fields" />
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
    <SidePanel.Field>
      <StorybookComponents.Placeholder height="48px" />
    </SidePanel.Field>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Custom footer
- description: To display confirmation or close actions use the `<SidePanel.Footer/>` container.
- example:
```jsx
<StorybookComponents.Stack flexDirection="column">
  <SidePanel>
    <SidePanel.Footer>
      <StorybookComponents.Placeholder height="36px" />
    </SidePanel.Footer>
  </SidePanel>
  <SidePanel>
    <SidePanel.Footer>
      <Button priority="secondary" fullWidth>
        Close
      </Button>
    </SidePanel.Footer>
  </SidePanel>
  <SidePanel>
    <SidePanel.Footer>
      <StorybookComponents.Stack justifyContent="flex-end" gap="12px">
        <Button priority="secondary">Cancel</Button>
        <Button>Save</Button>
      </StorybookComponents.Stack>
    </SidePanel.Footer>
  </SidePanel>
</StorybookComponents.Stack>;
```

### Draggable
- description: Let users know that panel position on the screen can be changed by changing the mouse cursor to grab with `draggable` property. The behaviour itself has to be developed separately.
- example:
```jsx
<SidePanel
  onCloseButtonClick={() => {}}
  skin="floating"
  width="288px"
  draggable
>
  <SidePanel.Header title="Draggable panel" />
  <SidePanel.Content>
    <StorybookComponents.Stack height="492px" />
  </SidePanel.Content>
</SidePanel>;
```

## Mobile Examples

### Mobile usage
- description: Keep `<SidePanel/>` as the layout of the panel and change only its container per screen. On desktop the panel slides in over the page from an absolutely positioned wrapper, as in the common use cases above. On mobile the same panel renders inside a bottom `<Drawer/>` that is non-modal and has no backdrop, so the page behind it stays visible and usable while users adjust settings. The panel takes the height of its content, capped by `maxHeight`, so the footer actions are always in view and longer content scrolls inside `<SidePanel.Content/>`. Set `dismissible` and `resizable` to `false` so a tap on the page does not close the panel and there is no drag handle. Closing goes through the panel's close button and footer actions on both screens. _To see the change, toggle 'Enable mobile support' in the top bar of Storybook._
- example:
```jsx
() => {
  const { mobile } = React.useContext(WixDesignSystemContext);
  const [isOpen, setIsOpen] = React.useState(false);
  const [text, setText] = React.useState('Luna Boutique');
  const [alignment, setAlignment] = React.useState(1);
  const [bold, setBold] = React.useState(true);

  const alignments = [
    { id: 0, value: 'Left' },
    { id: 1, value: 'Center' },
    { id: 2, value: 'Right' },
  ];

  const close = () => setIsOpen(false);

  const panel = (
    <SidePanel
      width={mobile ? '100%' : '420px'}
      height={mobile ? 'auto' : '100%'}
      maxHeight={mobile ? '75dvh' : undefined}
      closeButtonProps={{ onClick: close }}
    >
      <SidePanel.Header title="Customize text" />
      <SidePanel.Content>
        <Box direction="vertical" gap="SP4">
          <FormField label="Text">
            <Input value={text} onChange={(e) => setText(e.target.value)} />
          </FormField>
          <FormField label="Alignment">
            <Dropdown
              selectedId={alignment}
              options={alignments}
              onSelect={(option) => setAlignment(Number(option.id))}
            />
          </FormField>
          <FormField label="Bold" labelPlacement="left">
            <ToggleSwitch checked={bold} onChange={() => setBold(!bold)} />
          </FormField>
        </Box>
      </SidePanel.Content>
      <SidePanel.Footer>
        <Box align="right" gap="12px">
          <Button size="small" priority="secondary" onClick={close}>
            Cancel
          </Button>
          <Button size="small" onClick={close}>
            Save
          </Button>
        </Box>
      </SidePanel.Footer>
    </SidePanel>
  );

  return (
    <div style={{ position: 'relative', overflow: 'hidden', height: '480px' }}>
      <Box direction="vertical" gap="SP4" padding="SP4">
        <Box>
          <Button
            size="small"
            priority="secondary"
            onClick={() => setIsOpen(true)}
          >
            Customize text
          </Button>
        </Box>
        <Box
          align={
            alignments[alignment].value.toLowerCase() as
              | 'left'
              | 'center'
              | 'right'
          }
          padding="SP6"
          backgroundColor="D70"
          borderRadius="8px"
        >
          <Text size="medium" weight={bold ? 'bold' : 'normal'}>
            {text}
          </Text>
        </Box>
      </Box>

      {mobile ? (
        <Drawer
          open={isOpen}
          onClose={close}
          modal={false}
          dismissible={false}
          resizable={false}
          renderBackdrop={false}
          margin={false}
          scrollable={false}
        >
          {panel}
        </Drawer>
      ) : (
        <div
          style={{
            position: 'absolute',
            top: 0,
            right: isOpen ? 0 : '-440px',
            height: '100%',
            boxShadow:
              '0 3px 24px 0 rgba(22, 45, 61, 0.18), 0 8px 8px 0 rgba(22, 45, 61, 0.12)',
            transition: 'right 0.4s ease 0s',
            zIndex: 1000,
          }}
        >
          {panel}
        </div>
      )}
    </div>
  );
};
```

## Common Use Case Examples

### Settings panel
- description: Use side panel to create settings panels that allow users to control the design and behavior aspects of their app.
- example:
```jsx
<SidePanel onCloseButtonClick={() => {}} skin="floating" width="288px">
  <SidePanel.Header title="Button Settings" />
  <SidePanel.Field>
    <FormField label="Choose what displays">
      <Dropdown
        size="small"
        selectedId={0}
        options={[
          { id: 0, value: 'Text and icon' },
          { id: 1, value: 'Icon only' },
          { id: 2, value: 'Text only' },
          { id: 3, value: 'Nothing' },
        ]}
      />
    </FormField>
  </SidePanel.Field>
  <SidePanel.Field>
    <FormField label="Text">
      <Input size="small" value="New Folder" />
    </FormField>
  </SidePanel.Field>
  <SidePanel.Field>
    <FieldSet
      legend="Icon"
      columns="auto 30px 30px"
      gap="small"
      alignment="center"
    >
      <ImageViewer height="102px" width="160px" />
      <IconButton size="small" priority="secondary">
        <Icons.ReplaceSmall />
      </IconButton>
      <IconButton size="small" priority="secondary">
        <Icons.DeleteSmall />
      </IconButton>
    </FieldSet>
  </SidePanel.Field>
  <SidePanel.Field>
    <FormField label="Links to">
      <Button
        size="small"
        priority="secondary"
        fullWidth
        suffixIcon={<Icons.LinkSmall />}
      >
        Choose a link
      </Button>
    </FormField>
  </SidePanel.Field>
</SidePanel>;
```

### Group content in settings panels
- description: Use `<SidePanel.Section/>` wrapper to organize panel info into categories. It will make the whole panel easier to scan.
- example:
```jsx
() => {
  const [selectedOption, setSelectedOption] = React.useState(0);
  const options = [
    { id: 0, value: 'Monday' },
    { id: 1, value: 'Sunday' },
  ];
  return (
    <SidePanel
      maxHeight="576px"
      width="288px"
      skin="floating"
      onCloseButtonClick={() => {}}
    >
      <SidePanel.Header title="Calendar Settings" />
      <SidePanel.Content noPadding>
        <SidePanel.Field>
          <FormField label="Week starts on">
            <Dropdown
              value=""
              size="small"
              options={options}
              onSelect={(option) => setSelectedOption(Number(option.id))}
              selectedId={selectedOption}
            />
          </FormField>
        </SidePanel.Field>
        <SidePanel.Field>
          <FieldSet
            legend="Set active days"
            legendSize="small"
            legendPlacement="top"
            direction="vertical"
            gap="medium"
          >
            <Checkbox size="small" checked>
              Monday
            </Checkbox>
            <Checkbox size="small" checked>
              Tuesday
            </Checkbox>
            <Checkbox size="small" checked>
              Wednesday
            </Checkbox>
            <Checkbox size="small" checked>
              Thursday
            </Checkbox>
            <Checkbox size="small" checked>
              Friday
            </Checkbox>
            <Checkbox size="small">Saturday</Checkbox>
            <Checkbox size="small">Sunday</Checkbox>
          </FieldSet>
        </SidePanel.Field>
        <SidePanel.Section title="Available dates">
          <SidePanel.Field>
            <FieldSet
              legend="Available dates"
              alignment="end"
              direction="horizontal"
              legendPlacement="none"
            >
              <FormField label="From">
                <DatePicker
                  size="small"
                  width="auto"
                  onChange={() => {}}
                  placeholderText="Start"
                  popoverProps={{ appendTo: 'window' }}
                />
              </FormField>
              <FormField label="To">
                <DatePicker
                  size="small"
                  width="auto"
                  onChange={() => {}}
                  placeholderText="End"
                  popoverProps={{ appendTo: 'window' }}
                />
              </FormField>
              <Tooltip content="Delete">
                <IconButton size="small" priority="secondary">
                  <Icons.DeleteSmall />
                </IconButton>
              </Tooltip>
            </FieldSet>
          </SidePanel.Field>
          <SidePanel.Field>
            <TextButton size="small" prefixIcon={<Icons.AddSmall />}>
              Add Available Dates
            </TextButton>
          </SidePanel.Field>
        </SidePanel.Section>
        <SidePanel.Section title="Unavailable dates">
          <SidePanel.Field>
            <FieldSet
              legend="Unavailable dates"
              alignment="end"
              direction="horizontal"
              legendPlacement="none"
            >
              <FormField label="From">
                <DatePicker
                  size="small"
                  width="auto"
                  onChange={() => {}}
                  placeholderText="Start"
                  popoverProps={{ appendTo: 'window' }}
                />
              </FormField>
              <FormField label="To">
                <DatePicker
                  size="small"
                  width="auto"
                  onChange={() => {}}
                  placeholderText="End"
                  popoverProps={{ appendTo: 'window' }}
                />
              </FormField>
              <Tooltip content="Delete">
                <IconButton size="small" priority="secondary">
                  <Icons.DeleteSmall />
                </IconButton>
              </Tooltip>
            </FieldSet>
          </SidePanel.Field>
          <SidePanel.Field>
            <TextButton size="small" prefixIcon={<Icons.AddSmall />}>
              Add Unavailable Dates
            </TextButton>
          </SidePanel.Field>
        </SidePanel.Section>
      </SidePanel.Content>
    </SidePanel>
  );
};
```

### Data filter
- description: Use side panels to display data filters. When opened, the panels should slide in from the right side of the screen. Add close buttons in the header and/or footer that can be used to close the panel.
- example:
```jsx
() => {
  const [right, setRight] = React.useState(-440);
  const [records, setRecords] = React.useState([
    {
      image: <Image width="42px" height="42px" />,
    },
    {
      image: <Image width="42px" height="42px" />,
    },
    {
      image: <Image width="42px" height="42px" />,
    },
    {
      image: <Image width="42px" height="42px" />,
    },
    {
      image: <Image width="42px" height="42px" />,
    },
    {
      image: <Image width="42px" height="42px" />,
    },
    {
      image: <Image width="42px" height="42px" />,
    },
  ]);

  const columns = [
    {
      title: '',
      render: (row) => row.image,
    },
  ];

  const openPanel = () => {
    setRight(0);
  };

  const closePanel = () => {
    setRight(-440);
  };

  return (
    <div style={{ display: 'block', overflow: 'hidden', position: 'relative' }}>
      <Page height="780px" maxWidth={500}>
        <Page.Header title="Products" />
        <Page.Content>
          <Card>
            <Table data={records} columns={columns} rowVerticalPadding="tiny">
              <TableToolbar>
                <TableToolbar.ItemGroup position="start">
                  <TableToolbar.Item>
                    <TableToolbar.Label>7 products</TableToolbar.Label>
                  </TableToolbar.Item>
                </TableToolbar.ItemGroup>
                <TableToolbar.ItemGroup position="end">
                  <TableToolbar.Item>
                    <Button
                      size="small"
                      priority="secondary"
                      prefixIcon={<Icons.ContentFilterSmall />}
                      onClick={openPanel}
                    >
                      Filter
                    </Button>
                  </TableToolbar.Item>
                  <TableToolbar.Item>
                    <Search size="small" />
                  </TableToolbar.Item>
                </TableToolbar.ItemGroup>
              </TableToolbar>
              <Table.Content />
            </Table>
          </Card>
        </Page.Content>
      </Page>
      <div
        style={{
          position: 'absolute',
          top: 0,
          right: `${right}px`,
          height: '100%',
          boxShadow:
            '0 3px 24px 0 rgba(22, 45, 61, 0.18), 0 8px 8px 0 rgba(22, 45, 61, 0.12)',
          transition: 'right 0.4s ease 0s',
          zIndex: 1000,
        }}
      >
        <SidePanel onCloseButtonClick={closePanel}>
          <SidePanel.Header title="Filter" />
          <SidePanel.Footer>
            <Button onClick={closePanel} priority="secondary" fullWidth>
              Close
            </Button>
          </SidePanel.Footer>
        </SidePanel>
      </div>
    </div>
  );
};
```

### Quick view
- description: Use side panels to provide quick views of list items. Panels can either push the page content aside or overlay it, depending on the use case: - Overlay content when part of the page's content can be covered. - Push content aside when the user should see all the information and actions on the main page.
- example:
```jsx
() => {
  const [right, setRight] = React.useState(-440);
  const [records, setRecords] = React.useState([
    {
      image: <Avatar size="size36" name="Jenny Wilson" />,
    },
    {
      image: <Avatar size="size36" name="Robert Fox" />,
    },
    {
      image: <Avatar size="size36" name="Albert Flores" />,
    },
    {
      image: <Avatar size="size36" name="Floyd Miles" />,
    },
    {
      image: <Avatar size="size36" name="Esther Howard" />,
    },
    {
      image: <Avatar size="size36" name="Brooklyn Simmons" />,
    },
    {
      image: <Avatar size="size36" name="Kathryn Murphy" />,
    },
    {
      image: <Avatar size="size36" name="Dianne Russell" />,
    },
  ]);

  const columns = [
    {
      title: '',
      render: (row) => row.image,
    },
    {
      title: '',
      render: () => (
        <TableActionCell
          size="small"
          primaryAction={{
            text: 'View',
            onClick: () => {},
          }}
        />
      ),
    },
  ];

  const openPanel = () => {
    setRight(0);
  };

  const closePanel = () => {
    setRight(-440);
  };

  return (
    <div style={{ display: 'block', overflow: 'hidden', position: 'relative' }}>
      <Page height="780px" maxWidth={500}>
        <Page.Header title="Contacts" />
        <Page.Content>
          <Card>
            <Table data={records} columns={columns} onRowClick={openPanel}>
              <TableToolbar>
                <TableToolbar.ItemGroup position="start">
                  <TableToolbar.Item>
                    <TableToolbar.Label>8 contacts</TableToolbar.Label>
                  </TableToolbar.Item>
                </TableToolbar.ItemGroup>
              </TableToolbar>
              <Table.Content />
            </Table>
          </Card>
        </Page.Content>
      </Page>
      <div
        style={{
          position: 'absolute',
          top: 0,
          right: `${right}px`,
          height: '100%',
          boxShadow:
            '0 3px 24px 0 rgba(22, 45, 61, 0.18), 0 8px 8px 0 rgba(22, 45, 61, 0.12)',
          transition: 'right 0.4s ease 0s',
          zIndex: 1000,
        }}
      >
        <SidePanel onCloseButtonClick={closePanel}>
          <SidePanel.Header showDivider={false}>
            <Box direction="vertical" align="center" marginBottom="12px">
              <Avatar size="size72" />
            </Box>
            <Tabs
              items={[
                { id: 1, title: 'Overview' },
                { id: 2, title: 'Inbox' },
              ]}
              activeId={1}
              type="uniformSide"
              width="174px"
            />
          </SidePanel.Header>
        </SidePanel>
      </div>
    </div>
  );
};
```

### Composer actions
- description: Use side panels to display composer settings and actions. These should be anchored to the left edge of the screen since they're opened through the `<ComposerSidebar/>`.
- example:
```jsx
() => {
  const [selectedSidebar, setSelectedSidebar] = React.useState(0);
  const [activeTab, setActiveTab] = React.useState(0);
  const [toggleImage, setToggleImage] = React.useState(true);
  const [togglePosts, setTogglePosts] = React.useState(false);
  const [toggleCommenting, setToggleCommenting] = React.useState(false);
  const [descriptionValue, setDescriptionValue] = React.useState('');
  const [authorTags, setAuthorTags] = React.useState([]);
  const [categories, setCategories] = React.useState([
    {
      id: 0,
      label: 'Other posts',
      isChecked: false,
    },
    {
      id: 1,
      label: 'Recipes',
      isChecked: false,
    },
    {
      id: 2,
      label: 'Lifestyle',
      isChecked: false,
    },
  ]);
  const [publishDate, setPublishDate] = React.useState();
  const [themeTags, setThemeTags] = React.useState([
    { id: '1', label: 'Sport' },
    { id: '2', label: 'Routine' },
  ]);
  const [author, setAuthor] = React.useState();

  const items = [
    {
      id: 0,
      label: 'Settings',
      icon: <Icons.Settings />,
    },
    {
      id: 1,
      label: 'Categories',
      icon: <Icons.Category />,
    },
    {
      id: 2,
      label: 'Tags',
      icon: <Icons.Tag />,
    },
  ];

  const handleSelectTag = (tag, previousTags, setTags) =>
    setTags([...previousTags, { id: tag.id, label: tag.value }]);

  const handleRemoveTag = (tag, previousTags, setTags) =>
    setTags(previousTags.filter((currTag) => currTag.id !== tag));

  const handleSidebarClick = (id) => {
    setSelectedSidebar(id);
  };

  const handleCloseSidePanel = () => {
    setSelectedSidebar(null);
  };

  const renderSettingsPanel = () => (
    <SidePanel onCloseButtonClick={handleCloseSidePanel} width="300px">
      <SidePanel.Header title="Post settings" showDivider={false}>
        <Tabs
          items={[
            { id: 0, title: 'General' },
            { id: 1, title: 'Advanced' },
          ]}
          activeId={activeTab}
          type="uniformSide"
          width="114px"
          onClick={(value) => setActiveTab(Number(value.id))}
        />
      </SidePanel.Header>
      <SidePanel.Content></SidePanel.Content>
    </SidePanel>
  );

  const renderTagPanel = () => (
    <SidePanel onCloseButtonClick={handleCloseSidePanel} width="300px">
      <SidePanel.Header title="Tags" showDivider={false} />
      <SidePanel.Content />
    </SidePanel>
  );

  const renderCategoryPanel = () => {
    return (
      <SidePanel onCloseButtonClick={handleCloseSidePanel} width="300px">
        <SidePanel.Header title="Categories" showDivider={false} />
        <SidePanel.Content />
      </SidePanel>
    );
  };

  return (
    <Layout gap={0}>
      <Cell>
        <ComposerHeader backButtonValue="Back">
          <ComposerHeader.Actions justifyContent="flex-end">
            <ToggleButton labelValue="Undo">
              <Icons.Undo />
            </ToggleButton>
            <ToggleButton labelValue="Redo">
              <Icons.Redo />
            </ToggleButton>
          </ComposerHeader.Actions>
          <ComposerHeader.MainActions>
            <Button skin="inverted">Preview</Button>
            <Button>Publish</Button>
          </ComposerHeader.MainActions>
        </ComposerHeader>
      </Cell>
      <Cell>
        <Box direction="vertical" backgroundColor="D70">
          <Box gap="0" height="660px">
            <ComposerSidebar
              labelPlacement="bottom"
              items={items}
              selectedId={selectedSidebar}
              onClick={(_, { id }) => handleSidebarClick(id)}
            />
            {selectedSidebar === 0 && renderSettingsPanel()}
            {selectedSidebar === 1 && renderCategoryPanel()}
            {selectedSidebar === 2 && renderTagPanel()}
          </Box>
        </Box>
      </Cell>
    </Layout>
  );
};
```
