> 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: SidebarSubMenuNext Component

## Article: SidebarSubMenuNext Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/navigation/sidebar-divider-next/sidebar-sub-menu-next-component.md

## Article Content:

# SidebarSubMenuNext

_Components/Navigation/Sidebar_

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

## Overview

```jsx
() => {
  const [selectedKey, setSelectedKey] = React.useState('3-1');

  return (
    <StorybookComponents.Stack height="184px">
      <SidebarNext selectedKey={selectedKey} isLoading={false}>
        <SidebarSubMenuNext
          title="Contacts"
          itemKey="3"
          onClick={() => setSelectedKey('3-1')}
        >
          <SidebarItemNext itemKey="3-1" onClick={() => setSelectedKey('3-1')}>
            Contacts
          </SidebarItemNext>
          <SidebarItemNext itemKey="3-2" onClick={() => setSelectedKey('3-2')}>
            Segments
          </SidebarItemNext>
          <SidebarItemNext itemKey="3-3" onClick={() => setSelectedKey('3-3')}>
            Site Members
          </SidebarItemNext>
          <SidebarItemNext itemKey="3-4" onClick={() => setSelectedKey('3-4')}>
            Workflows
          </SidebarItemNext>
        </SidebarSubMenuNext>
      </SidebarNext>
    </StorybookComponents.Stack>
  );
};
```

SidebarSubMenuNext allows to put a list of options into a collapsible group. This component is part of SidebarNext component.

### Do

- Use it to build `<SidebarNext/>` navigation

### Don't

- Don't use it as a stand alone component

### Feature examples

#### Structure

Component consists of 2 containers:

\- `title` - use it do display sub item's label.

\- `children` - use it do display item's child actions.

```jsx
<StorybookComponents.Stack>
  <SidebarSubMenuNext title="Label">
    <SidebarItemNext>Child label</SidebarItemNext>
    <SidebarItemNext>Child label</SidebarItemNext>
  </SidebarSubMenuNext>
</StorybookComponents.Stack>;
```

#### Suffix

Add a counter badge or other indication after the item's label using `suffix` prop.

```jsx
<StorybookComponents.Stack>
  <SidebarSubMenuNext
    title="Parent label"
    suffix={<CounterBadge>1</CounterBadge>}
  >
    <SidebarItemNext>Child label</SidebarItemNext>
    <SidebarItemNext>Child label</SidebarItemNext>
  </SidebarSubMenuNext>
</StorybookComponents.Stack>;
```

#### Disabled

Control item's interaction with `disabled` prop. Disable item when it's unavailable, but has to remain visible.

```jsx
<StorybookComponents.Stack>
  <SidebarSubMenuNext title="Disabled" disabled>
    <SidebarItemNext>Child label</SidebarItemNext>
    <SidebarItemNext>Child label</SidebarItemNext>
  </SidebarSubMenuNext>
</StorybookComponents.Stack>;
```

### Developer examples

#### Custom HTML tag

Render action as any given HTML tag with `as` prop. For example it can be rendered as:

`<a>` - use when attributes like href, target, etc., are needed.

`<Link>` - use this react router item to have props like to, replace, etc.

All attributes will be passed to the rendered element.

**Link works only if any of inner elements are NOT selected.**

```jsx
<StorybookComponents.Stack height="55px">
  <SidebarNext isLoading={false} selectedKey="0">
    <SidebarSubMenuNext
      title="Go to Wix.com"
      as="a"
      target="_blank"
      href="https://www.wix.com"
    >
      <SidebarItemNext>Child item</SidebarItemNext>
      <SidebarItemNext>Child item</SidebarItemNext>
    </SidebarSubMenuNext>
  </SidebarNext>
</StorybookComponents.Stack>;
```

#### Setup selection with sidebar

Control item selection from Sidebar component referring to `itemKey` set value.

Truncate children item's text with `isInQuickNavigation` prop.

```jsx
() => {
  const [selectedKey, setSelectedKey] = React.useState('1-1');

  return (
    <Box height="200px">
      <SidebarNext isLoading={false} selectedKey={selectedKey}>
        <SidebarSubMenuNext
          title="Parent item"
          itemKey="1"
          onClick={() => setSelectedKey('1-1')}
        >
          <SidebarItemNext
            itemKey="1-1"
            onClick={() => {
              setSelectedKey('1-1');
            }}
            isInQuickNavigation
          >
            Child item with a long label to show its ellipsis
          </SidebarItemNext>
          <SidebarItemNext
            itemKey="1-2"
            onClick={() => setSelectedKey('1-2')}
            isInQuickNavigation
          >
            Child item using isInQuickNavigation property preveting from text
            being wrapped
          </SidebarItemNext>
        </SidebarSubMenuNext>
      </SidebarNext>
    </Box>
  );
};
```

### Common use case examples

#### Navigating between items

Redirect `<SidebarSubMenuNext/>` selection to its first child when clicked. It helps a user to understand sidebar's hierarchy and navigate between the items easily.

```jsx
() => {
  const [selectedKey, setSelectedKey] = React.useState('3-1');

  return (
    <StorybookComponents.Stack height="384px">
      <SidebarNext selectedKey={selectedKey} isLoading={false}>
        <SidebarSubMenuNext
          title="Contacts"
          itemKey="3"
          onClick={() => setSelectedKey('3-1')}
        >
          <SidebarItemNext itemKey="3-1" onClick={() => setSelectedKey('3-1')}>
            Contacts
          </SidebarItemNext>
          <SidebarItemNext itemKey="3-2" onClick={() => setSelectedKey('3-2')}>
            Segments
          </SidebarItemNext>
          <SidebarItemNext itemKey="3-3" onClick={() => setSelectedKey('3-3')}>
            Site Members
          </SidebarItemNext>
          <SidebarItemNext itemKey="3-4" onClick={() => setSelectedKey('3-4')}>
            Workflows
          </SidebarItemNext>
        </SidebarSubMenuNext>
        <SidebarSubMenuNext
          title="Communications"
          itemKey="3"
          onClick={() => setSelectedKey('4-1')}
        >
          <SidebarItemNext itemKey="4-1" onClick={() => setSelectedKey('4-1')}>
            Inbox
          </SidebarItemNext>
          <SidebarItemNext itemKey="4-2" onClick={() => setSelectedKey('4-2')}>
            Chat
          </SidebarItemNext>
          <SidebarItemNext itemKey="4-3" onClick={() => setSelectedKey('4-3')}>
            Forms & Submissions
          </SidebarItemNext>
          <SidebarItemNext itemKey="4-4" onClick={() => setSelectedKey('4-4')}>
            Business Email
          </SidebarItemNext>
        </SidebarSubMenuNext>
      </SidebarNext>
    </StorybookComponents.Stack>
  );
};
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `as` | `"button"` | `'button'` | Renders the submenu trigger as another HTML tag or component. |
| `children` | `ReactNode` | — | Sets the items nested under this submenu. |
| `dataHook` | `string` | — | Applied as data-hook HTML attribute that can be used in the tests. |
| `disabled` | `boolean` | — | Indicates whether to display the item as disabled. |
| `href` | `string` | — | URL of the page that link goes to. |
| `itemKey` | `string` | — | Sets a unique key for the submenu. The submenu is marked as selected and expanded when it or one of its nested items matches the `selectedKey` of `<SidebarNext/>`, and the key is passed to `onClick` as the second argument. |
| `onClick` | `MouseEventHandler` | — | A callback to be triggered on click. |
| `onCollapse` | `(trigger: ExpandCollapseTrigger) => void` | — | A callback to be triggered when the sub menu collapses. |
| `onExpand` | `(trigger: ExpandCollapseTrigger) => void` | — | A callback to be triggered when the sub menu expands. |
| `onQuickNavOpen` | `() => void` | — | A callback to be triggered when the quick nav opens. |
| `prefix` | `ReactNode` | — | An element to appear at the start of the title. |
| `suffix` | `ReactNode` | — | An element to appear at the end of the title. |
| `title` | `string \| ComponentClass<{}, any> \| FunctionComponent<{}>` | — | An element to appear as the title of the submenu. |

## Testkit

No testkit for this component — it doesn't expose a unidriver testkit.

## Changelog

- **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.332.0** (2026-10-05) — maintenance release, no component-specific changes
- **1.331.0** (2026-10-01) — 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.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.318.0** (2026-08-28) — maintenance release, no component-specific changes
- **1.317.1** (2026-08-26) — maintenance release, no component-specific changes
- **1.313.1** (2026-08-18) — maintenance release, no component-specific changes
- **1.311.0** (2026-08-12) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.308.1** (2026-08-05) — maintenance release, no component-specific changes
- **1.299.0** (2026-07-17) — maintenance release, no component-specific changes
- **1.297.0** (2026-07-09) — maintenance release, no component-specific changes
- **1.295.0** (2026-07-03) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — 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.250.0** (2026-01-27) — maintenance release, no component-specific changes
- **1.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.212.0** (2025-08-11) — maintenance release, no component-specific changes
- **1.165.0** (2025-02-27) — fix: increase height of the container ([#14562](invalid-url))
- **1.144.0** (2024-12-03) — maintenance release, no component-specific changes
- **1.143.0** (2024-11-25) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.131.0** (2024-10-10) — fix: restore selected submenu hover state ([#14206](invalid-url))
- **1.119.0** (2024-07-31) — maintenance release, no component-specific changes
- **1.115.0** (2024-07-17) — maintenance release, no component-specific changes
- **1.104.1** (2024-05-14) — maintenance release, no component-specific changes
- **1.101.0** (2024-04-12) — maintenance release, no component-specific changes
- **1.98.0** (2024-03-15) — maintenance release, no component-specific changes
- **1.95.1** (2024-02-19) — fix: collapsed sidebar - selected state color is wrong ([#13250](invalid-url))
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes