> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: ComposerSidebar Component

## Article: ComposerSidebar Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/navigation/composer-header/composer-sidebar-component.md

## Article Content:

# ComposerSidebar

_Components/Navigation/Composer_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/composersidebar>

## Overview

```jsx
() => {
  const items = [
    {
      id: 0,
      label: 'Crop & Rotate',
      icon: <Icons.CropRotate />,
    },
    {
      id: 1,
      label: 'Enhance',
      icon: <Icons.MagicWand />,
    },
    {
      id: 2,
      label: 'Adjust',
      icon: <Icons.Adjust />,
    },
    {
      id: 3,
      label: 'Cut Out',
      icon: <Icons.CutOut />,
    },
    {
      id: 4,
      label: 'Text',
      icon: <Icons.Rename />,
    },
  ];

  return <ComposerSidebar labelPlacement="end" items={items} selectedId={1} />;
};
```

Composer sidebar is a local navigation used to control the composer's settings panel.

### Do

- Use it to list the categories of composer's `<SidePanel/>` settings.

### Don't

- Don't use it in layouts other than the composer.

### Feature examples

#### Size

Control component size with \`size\` prop:\
 - \`large\` - use it when the component needs to be emphasized.\
 - \`medium\` (default) - use it in all default cases, especially if there are many (5 or more) items to show.\
 - \`small\` - use in more dense layouts.

```jsx
() => {
  return (
    <StorybookComponents.Stack justifyContent="space-around">
      <ComposerSidebar
        size="large"
        items={[
          {
            id: 0,
            label: 'Large',
            icon: <Icons.CropRotate />,
          },
          {
            id: 1,
            label: 'Large',
            icon: <Icons.MagicWand />,
          },
          {
            id: 2,
            label: 'Large',
            icon: <Icons.Adjust />,
          },
          {
            id: 3,
            label: 'Large',
            icon: <Icons.CutOut />,
          },
        ]}
      />
      <ComposerSidebar
        size="medium"
        items={[
          {
            id: 0,
            label: 'Medium',
            icon: <Icons.CropRotate />,
          },
          {
            id: 1,
            label: 'Medium',
            icon: <Icons.MagicWand />,
          },
          {
            id: 2,
            label: 'Medium',
            icon: <Icons.Adjust />,
          },
          {
            id: 3,
            label: 'Medium',
            icon: <Icons.CutOut />,
          },
        ]}
      />
      <ComposerSidebar
        size="small"
        items={[
          {
            id: 0,
            label: 'Small',
            icon: <Icons.CropRotate />,
          },
          {
            id: 1,
            label: 'Small',
            icon: <Icons.MagicWand />,
          },
          {
            id: 2,
            label: 'Small',
            icon: <Icons.Adjust />,
          },
          {
            id: 3,
            label: 'Small',
            icon: <Icons.CutOut />,
          },
        ]}
      />
    </StorybookComponents.Stack>
  );
};
```

#### Label Placement

Control the position of a toggle button labels with \`labelPlacement\` prop. It supports 2 values:\
 - \`end\` (default) - use it if there are many (5 or more) items to show. Button width depends on a label length but has a max width of 270 px. Label will be truncated if the limit is reached.\
 - \`bottom\` - use it with few items to show. Component's width is fixed to 90 px.\
 - \`tooltip\` - use it only for professional tools that users are good at and use side actions repeatedly. For example, image editing tools like color fill, text, shape, etc. Configure tooltip's placement and size with \`labelTooltipProps\`.

```jsx
() => {
  const items = [
    {
      id: 0,
      label: 'Crop & Rotate',
      icon: <Icons.CropRotate />,
    },
    {
      id: 1,
      label: 'Enhance',
      icon: <Icons.MagicWand />,
    },
    {
      id: 2,
      label: 'Adjust',
      icon: <Icons.Adjust />,
    },
    {
      id: 3,
      label: 'Cut Out',
      icon: <Icons.CutOut />,
    },
    {
      id: 4,
      label: 'Text',
      icon: <Icons.Rename />,
    },
  ];

  return (
    <StorybookComponents.Stack justifyContent="space-around">
      <ComposerSidebar labelPlacement="end" items={items} />
      <ComposerSidebar labelPlacement="bottom" items={items} />
      <ComposerSidebar labelPlacement="tooltip" items={items} />
    </StorybookComponents.Stack>
  );
};
```

#### Ellipsis

Use `ellipsis` prop to change between truncated or wrapped label.

```jsx
() => {
  const items = [
    {
      id: 0,
      label: 'Item',
      icon: <Icons.CropRotate />,
    },
    {
      id: 1,
      label: 'Item with a very very long label',
      icon: <Icons.MagicWand />,
    },
    {
      id: 2,
      label: 'Item',
      icon: <Icons.Adjust />,
    },
    {
      id: 3,
      label: 'Item',
      icon: <Icons.CutOut />,
    },
    {
      id: 4,
      label: 'Item',
      icon: <Icons.Rename />,
    },
  ];

  return (
    <StorybookComponents.Stack justifyContent="space-around">
      <ComposerSidebar ellipsis={true} labelPlacement="end" items={items} />
      <ComposerSidebar ellipsis={false} labelPlacement="end" items={items} />
    </StorybookComponents.Stack>
  );
};
```

#### Selected Item

Highlight currently selected item with \`selectedId\` prop.

```jsx
() => {
  const items = [
    {
      id: 0,
      label: 'Item',
      icon: <Icons.CropRotate />,
    },
    {
      id: 1,
      label: 'Selected Item',
      icon: <Icons.MagicWand />,
    },
    {
      id: 2,
      label: 'Item',
      icon: <Icons.Adjust />,
    },
    {
      id: 3,
      label: 'Item',
      icon: <Icons.CutOut />,
    },
  ];

  return <ComposerSidebar labelPlacement="end" items={items} selectedId={1} />;
};
```

#### Disabled Item

Show that a certain action or category in a sidebar is not available with \`disabled\` prop.

```jsx
() => {
  const items = [
    {
      id: 0,
      label: 'Item',
      icon: <Icons.CropRotate />,
    },
    {
      id: 1,
      label: 'Disabled Item',
      icon: <Icons.MagicWand />,
      disabled: true,
    },
    {
      id: 2,
      label: 'Item',
      icon: <Icons.Adjust />,
    },
    {
      id: 3,
      label: 'Item',
      icon: <Icons.CutOut />,
    },
  ];

  return <ComposerSidebar labelPlacement="end" items={items} />;
};
```

#### Section Title

Group related items together with sections using \`sectionTitle\` prop.

```jsx
() => {
  const items = [
    {
      id: 0,
      sectionTitle: 'Section 1',
      label: 'Item',
      icon: <Icons.CropRotate />,
    },
    {
      id: 1,
      sectionTitle: 'Section 1',
      label: 'Item',
      icon: <Icons.MagicWand />,
    },
    {
      id: 2,
      sectionTitle: 'Section 2',
      label: 'Item',
      icon: <Icons.Adjust />,
    },
    {
      id: 3,
      sectionTitle: 'Section 2',
      label: 'Item',
      icon: <Icons.CutOut />,
    },
  ];

  return <ComposerSidebar labelPlacement="end" items={items} />;
};
```

#### Pinned Items

Keep up to 3 items, such as language or help, at the bottom edge of the sidebar with \`pinToBottom\`. Pinned items stay visible when the other items scroll, and they don't show a section title.

```jsx
() => {
  const items = [
    {
      id: 0,
      label: 'Crop',
      icon: <Icons.CropRotate />,
    },
    {
      id: 1,
      label: 'Enhance',
      icon: <Icons.MagicWand />,
    },
    {
      id: 2,
      label: 'Adjust',
      icon: <Icons.Adjust />,
    },
    {
      id: 3,
      label: 'Language',
      icon: <Icons.Globe />,
      pinToBottom: true,
    },
    {
      id: 4,
      label: 'Help',
      icon: <Icons.Help />,
      pinToBottom: true,
    },
  ];

  return (
    <Box height="400px">
      <ComposerSidebar labelPlacement="tooltip" items={items} selectedId={0} />
    </Box>
  );
};
```

### Common use case examples

#### Composer Settings

Use the composer sidebar to display available tools and settings in the composer environment.\
\
Position it below the [`<ComposerHeader/>`](https://wix-style-react.com/?path=/story/components-navigation-composer--composerheader) and fix it to the start of the remaining composer content area.

```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(null);
  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 authorOptions = [
    listItemSelectBuilder({
      id: 0,
      prefix: <Avatar size="size18" />,
      title: 'Doe John',
      label: 'Doe John',
    }),
    listItemSelectBuilder({
      id: 1,
      prefix: <Avatar size="size18" />,
      title: 'John Doe',
      label: 'John Doe',
    }),
    listItemActionBuilder({
      id: 'new-author',
      title: 'New Author',
      prefixIcon: <Icons.Add />,
    }),
  ];

  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 width="300px" onCloseButtonClick={handleCloseSidePanel}>
      <SidePanel.Header title="Post Settings">
        <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>
        {activeTab === 0 && (
          <Box direction="vertical" gap="24px">
            <FormField label="Display cover image" labelPlacement="left">
              <ToggleSwitch
                checked={toggleImage}
                onChange={() => setToggleImage(!toggleImage)}
              />
            </FormField>
            {toggleImage && (
              <Cell>
                <Box height="120px">
                  <AddItem theme="image" tooltipContent="Add Item" />
                </Box>
              </Cell>
            )}
            <FormField label="Publish date">
              <DatePicker
                width="100%"
                placeholderText="Publish Now"
                popoverProps={{ appendTo: 'scrollParent' }}
                autoFocus={false}
                value={publishDate}
                onChange={(date) => setPublishDate(date)}
              />
            </FormField>
            <FormField label="Author">
              <AutoComplete
                placeholder="Select Author"
                options={authorOptions}
                selectedId={author}
                popoverProps={{ appendTo: 'window' }}
                value={author}
                onSelect={(option) => setAuthor(option.label)}
                onChange={(event) => setAuthor(event.target.value)}
              />
            </FormField>
            <FormField label="Set as featured post" labelPlacement="left">
              <ToggleSwitch
                checked={togglePosts}
                onChange={() => setTogglePosts(!togglePosts)}
              />
            </FormField>
          </Box>
        )}
        {activeTab === 1 && (
          <Box direction="vertical" gap="24px">
            <FormField label="Description">
              <InputArea
                placeholder="Add a description..."
                value={descriptionValue}
                onChange={(e) => setDescriptionValue(e.target.value)}
                maxLength={140}
                hasCounter
              />
            </FormField>
            <FormField label="Related post">
              <MultiSelect
                tags={authorTags}
                options={[
                  { id: '1', value: 'British authors' },
                  { id: '2', value: 'French authors' },
                ]}
                customSuffix={
                  <Box>
                    <TextButton prefixIcon={<Icons.Add />}>
                      Add Posts
                    </TextButton>
                  </Box>
                }
                onSelect={(tag) =>
                  handleSelectTag(tag, authorTags, setAuthorTags)
                }
                onRemoveTag={(tag) =>
                  handleRemoveTag(tag, authorTags, setAuthorTags)
                }
              />
            </FormField>
            <FormField label="Enable commenting" labelPlacement="left">
              <ToggleSwitch
                checked={toggleCommenting}
                onChange={() => setToggleCommenting(!toggleCommenting)}
              />
            </FormField>
          </Box>
        )}
      </SidePanel.Content>
    </SidePanel>
  );

  const renderTagPanel = () => (
    <SidePanel width="300px" onCloseButtonClick={handleCloseSidePanel}>
      <SidePanel.Header title="Tags" showDivider={false} />
      <SidePanel.Content noPadding>
        <Box
          direction="vertical"
          gap="24px"
          width="252px"
          padding="0 24px 24px 24px"
        >
          <Text>
            Add tags that describe what your post is about. Readers can use them
            to find other posts with similar content.
          </Text>
          <FormField label="Tags">
            <MultiSelect
              tags={themeTags}
              options={[
                { id: '1', value: 'Sport' },
                { id: '2', value: 'Routine' },
              ]}
              onSelect={(tag) => handleSelectTag(tag, themeTags, setThemeTags)}
              onRemoveTag={(tag) =>
                handleRemoveTag(tag, themeTags, setThemeTags)
              }
            />
          </FormField>
        </Box>
      </SidePanel.Content>
    </SidePanel>
  );

  const renderCheckboxes = () => {
    return categories.map((item) => {
      const handleChecked = (id) => {
        const updatedCategories = [...categories];
        const index = categories.findIndex((c) => c.id === id);
        updatedCategories[index].isChecked =
          !updatedCategories[index].isChecked;
        setCategories(updatedCategories);
      };

      return (
        <Checkbox
          checked={item.isChecked}
          onChange={() => handleChecked(item.id)}
          id={item.id}
        >
          {item.label}
        </Checkbox>
      );
    });
  };

  const renderCategoryPanel = () => {
    return (
      <SidePanel width="300px" onCloseButtonClick={handleCloseSidePanel}>
        <SidePanel.Header title="Categories" showDivider={false} />
        <SidePanel.Content noPadding>
          <Box
            direction="vertical"
            gap="24px"
            width="252px"
            padding="0 24px 24px 24px"
          >
            <Text>
              Let readers browse your posts by topic, e.g. food, lifestyle &
              travel.
            </Text>
            <FormField label="Assign a category">
              <Box direction="vertical" gap="12px">
                {renderCheckboxes()}
                <TextButton prefixIcon={<Icons.Add />}>
                  Create category
                </TextButton>
              </Box>
            </FormField>
          </Box>
        </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">
          <Box gap="0" height="600px">
            <ComposerSidebar
              labelPlacement="bottom"
              items={items}
              selectedId={selectedSidebar}
              onClick={(_, { id }) => handleSidebarClick(id)}
            />

            {selectedSidebar === 0 && renderSettingsPanel()}
            {selectedSidebar === 1 && renderCategoryPanel()}
            {selectedSidebar === 2 && renderTagPanel()}

            <Box backgroundColor="D70" width="100%">
              <Box width="100%" padding={4}>
                <StorybookComponents.Placeholder>
                  <Box verticalAlign="middle" align="center" height="100%">
                    <Text>Composer content area</Text>
                  </Box>
                </StorybookComponents.Placeholder>
              </Box>
            </Box>
          </Box>
        </Box>
      </Cell>
    </Layout>
  );
};
```

## Code

```jsx
import { ComposerSidebar } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute to be used in the tests. |
| `ellipsis` | `boolean` | `true` | Controls the ellipsis of the item label. |
| `items` | `ComposerSidebarItem[]` | — | Defines an array of items, each a button with a label, to show on the sidebar: - `label`: text string next to a button - `icon`: icon shown in the toggle button - `disabled`: disables the item - `onClick`: defines what happens when the item is clicked on - `sectionTitle`: defines a section under which each item is placed - `pinToBottom`: pins the item to a group at the bottom edge of the sidebar. |
| `labelPlacement` | `"end" \| "start" \| "bottom" \| "tooltip"` | `'end'` | Controls the items' label placement. |
| `labelTooltipProps` | `TooltipCommonProps` | — | Controls the items' label tooltip when labelPlacement is set to tooltip. |
| `onClick` | `ComposerSidebarItemClickHandler` | — | Defines a default click handler for items, called with the click event and the clicked item's `id` and `label`. |
| `ref` | `null \| string \| (instance: null) => void \| RefObject<never>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
| `selectedId` | `string \| number` | `null` | Defines which item is currently selected. |
| `size` | `string` | `'medium'` | Sets the size of the items. |
| `toggleButtonProps` | `ButtonAsButtonProps<{ className?: string \| undefined; children?: ReactNode; skin?: ToggleButtonSkin \| undefined; size?: "small" \| "tiny" \| "medium" \| "large" \| undefined; ... 10 more ...; tooltipDisabled?: boolean \| undefined; }> \| ButtonAsAnchorProps<{ className?: string \| undefined; children?: ReactNode; skin?: ToggleButtonSkin \| undefined; size?: "small" \| "tiny" \| "medium" \| "large" \| undefined; ... 10 more ...; tooltipDisabled?: boolean \| undefined; }> \| ButtonGenericProps<{ className?: string \| undefined; children?: ReactNode; skin?: ToggleButtonSkin \| undefined; size?: "small" \| "tiny" \| "medium" \| "large" \| undefined; ... 10 more ...; tooltipDisabled?: boolean \| undefined; }> \| ButtonAsComponentProps<{ className?: string \| undefined; children?: ReactNode; skin?: ToggleButtonSkin \| undefined; size?: "small" \| "tiny" \| "medium" \| "large" \| undefined; ... 10 more ...; tooltipDisabled?: boolean \| undefined; }>` | — | Applies additional props to every item's `<ToggleButton/>`, such as `skin` or `shape`. Sidebar props (`size`, `labelPlacement`, `labelTooltipProps`) and item state take precedence. |
| `width` | `string \| number` | — | Sets the width of the container. |

## Testkit

Import the driver matching your test environment:

```jsx
// UniDriver
import { ComposerSidebarUniDriver } from '@wix/design-system/dist/testkit/unidriver';

// Vanilla
import { ComposerSidebarTestkit } from '@wix/design-system/dist/testkit';

// Puppeteer
import { ComposerSidebarTestkit } from '@wix/design-system/dist/testkit/puppeteer';

// Testing Library
import { ComposerSidebarTestkit } from '@wix/design-system/dist/testkit/testing-library';
```

### Driver methods

| Method | Description |
| --- | --- |
| `getSelectedItemId` | returns selected item id |
| `isItemDisabled` | returns true if item is disabled |
| `clickOnItem` | clicks on given item by id |
| `getItemLabel` | returns item label value by id |
| `getLabelPlacement` | returns label placement value |
| `getItemSectionTitle` | returns item section title by id |
| `exists` | Checks whether the component found with the given data hook. |
| `element` | Gets the component root element. |
| `click` | Clicks on the component root element. |
| `base` | Returns UniDriver for the base element. |

## Changelog

- **1.345.0** — feat: added `pinToBottom` to `items`, which keeps an item in a group at the bottom edge of the sidebar that stays visible while the other items scroll. ([#17606](invalid-url)) — has visual changes
- **1.344.0** (2026-10-28) — maintenance release, no component-specific changes
- **1.340.0** (2026-10-21) — maintenance release, no component-specific changes
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.330.0** (2026-09-28) — maintenance release, no component-specific changes
- **1.329.0** (2026-09-24) — maintenance release, no component-specific changes
- **1.328.0** (2026-09-22) — maintenance release, no component-specific changes
- **1.327.0** (2026-09-21) — maintenance release, no component-specific changes
- **1.326.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.320.0** (2026-09-03) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.303.0** (2026-07-23) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.291.0** (2026-06-19) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — maintenance release, no component-specific changes
- **1.258.0** (2026-02-23) — fix: add arrow navigation ([#15929](invalid-url)) — has visual changes
- **1.250.0** (2026-01-27) — maintenance release, no component-specific changes
- **1.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.208.0** (2025-07-25) — maintenance release, no component-specific changes
- **1.172.1** (2025-03-21) — fix: enable interactivity of toggle buttons ([#14650](invalid-url))
- **1.165.0** (2025-02-27) — fix: make selected `ToggleButtons` non-interactive ([#14560](invalid-url))
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.123.0** (2024-08-26) — feat: add ellipsis prop ([#14052](invalid-url))
- **1.104.0** (2024-05-06) — fix: new padding for small size ([#13693](invalid-url))
- **1.103.1** (2024-04-24) — maintenance release, no component-specific changes
- **1.103.0** (2024-04-23) — fix: inner container now matches root container width properly ([#13619](invalid-url))
- **1.102.0** (2024-04-16) — maintenance release, no component-specific changes
- **1.100.0** (2024-04-04) — feat: width prop added ([#13548](invalid-url))
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes