> ## Documentation Index
> Fetch the complete documentation index at: https://www.beeq.design/llms.txt
> Use this file to discover all available pages before exploring further.

# Side Menu

> Side menus provide persistent vertical navigation for applications with multiple sections, features, or hierarchy levels.

![BEEQ Side Menu component overview](https://mintcdn.com/beeq/uQ_Kuh3HHK5CbrgS/components/images/side-menu/side-menu-overview-light.svg?fit=max\&auto=format\&n=uQ_Kuh3HHK5CbrgS\&q=85\&s=a5135eb3d8692d0a5af5bb3b4722956f)

Side Menu overview

The side menu is a vertical navigation element that sits alongside a page or application layout. It acts as a central hub for accessing sections, features, and functionality.

> [!NOTE]
>
> Use `bq-side-menu-item` inside `bq-side-menu`; side menu items rely on the parent menu to manage collapsed and selected states.

## When to use

> [card]
>
> Use side menus when
>
> * A website or application has extensive content or multiple hierarchical levels
> * A compact and organized navigation system is necessary
> * Users need persistent access to primary sections while they work

> [card]
>
> Do not use side menus when
>
> * The menu reduces the visibility of primary content
> * The interface is focused on reading or content consumption
> * The layout is too narrow to support persistent navigation
> * The rows do not navigate, such as a list of files or search results; use a native list styled with BEEQ tokens

## Patterns

> [card] Default view
>
> Navigation items remain visible while users scroll. This gives people a persistent representation of the product structure.

> [card] Collapsible view
>
> The collapsible view reduces the menu to a compact rail. Use it when space is constrained or when users need more room for content.

> [!TIP]
>
> For grid sizes M to XS, applicable to viewports of 768 pixels and below, display the side menu in collapsed mode.

## Anatomy

![BEEQ Side Menu component anatomy](https://mintcdn.com/beeq/uQ_Kuh3HHK5CbrgS/components/images/side-menu/side-menu-anatomy-light.svg?fit=max\&auto=format\&n=uQ_Kuh3HHK5CbrgS\&q=85\&s=c9cdbd0277f68b4ce3ab519a1ab652d0)

Side Menu anatomy

A side menu is a vertical container that holds navigation items, with optional `logo` and `footer` slots for brand content and supplementary controls. The logo sits above the items and has no callout in the figure.

| Part | Element | Description |
| - | - | - |
| **1** | Container | The `<aside>` root (`base` part) that holds the logo, the navigation items and the footer |
| **2** | Active item | The `bq-side-menu-item` with the `active` attribute, which marks the current location |
| **3** | Navigation item | A default `bq-side-menu-item` with an optional `prefix` icon, a label and an optional `suffix` |
| **4** | Collapse control | An action you place in the `footer` slot to expand and collapse the menu. The `collapse` prop on `bq-side-menu` drives the state; the component does not render this control for you |

## Design guidelines

![Keep navigation available](https://www.beeq.design/components/images/side-menu/side-menu-keep-navigation-light.svg)
![Keep navigation available](https://www.beeq.design/components/images/side-menu/side-menu-keep-navigation-dark.svg)

## Keep navigation available

The side menu can scroll separately from the main content. This keeps navigation available when the page content is long.

![Write clear labels](https://www.beeq.design/components/images/side-menu/side-menu-clear-labels-light.svg)
![Write clear labels](https://www.beeq.design/components/images/side-menu/side-menu-clear-labels-dark.svg)

## Write clear labels

Use short, unique labels in sentence case. The link text should explain the destination without extra context.

## Usage

### Default

The default side menu is a versatile container for organizing and displaying navigation elements. Use it as the foundation for structured and intuitive navigation layouts.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
.app-logo {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-s);
  padding-inline: var(--bq-spacing-m);
  padding-block-start: var(--bq-spacing-m);
}

.app-logo svg {
  height: 2.5rem;
  width: 2.5rem;
}

.app-logo h1 {
  font-size: var(--bq-font-size--xl);
  white-space: nowrap;
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu>
  <div slot="logo">
    <bq-icon name="square-logo" size="40"></bq-icon>
    <h1>App Name</h1>
  </div>
  <bq-divider></bq-divider>
  <bq-side-menu-item active>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Dashboard
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Products
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
  <bq-side-menu-item disabled>
    <bq-icon name="gauge" slot="prefix"></bq-icon>
    Performance
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="truck" slot="prefix" ></bq-icon>
    Deliver
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="files" slot="prefix" ></bq-icon>
    Documents
  </bq-side-menu-item>
</bq-side-menu>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";
import "./styles.css";

<BqSideMenu>
  <div slot="logo">
    <BqIcon name="square-logo" size="40" />
    <h1>App Name</h1>
  </div>
  <BqDivider />
  <BqSideMenuItem active>
    <BqIcon name="diamonds-four" slot="prefix" />
    Dashboard
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="package" slot="prefix" />
    Products
    <BqBadge slot="suffix">5</BqBadge>
  </BqSideMenuItem>
  <BqSideMenuItem disabled>
    <BqIcon name="gauge" slot="prefix" />
    Performance
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="truck" slot="prefix" />
    Deliver
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="files" slot="prefix" />
    Documents
  </BqSideMenuItem>
</BqSideMenu>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu>
      <div slot="logo">
        <bq-icon name="square-logo" size="40"></bq-icon>
        <h1>App Name</h1>
      </div>
      <bq-divider></bq-divider>
      <bq-side-menu-item active>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Dashboard
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Products
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
      <bq-side-menu-item disabled>
        <bq-icon name="gauge" slot="prefix"></bq-icon>
        Performance
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="truck" slot="prefix" ></bq-icon>
        Deliver
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="files" slot="prefix" ></bq-icon>
        Documents
      </bq-side-menu-item>
    </bq-side-menu>
  `,
  styles: [`
    .app-logo {
      display: flex;
      align-items: center;
      gap: var(--bq-spacing-s);
      padding-inline: var(--bq-spacing-m);
      padding-block-start: var(--bq-spacing-m);
    }

    .app-logo svg {
      height: 2.5rem;
      width: 2.5rem;
    }

    .app-logo h1 {
      font-size: var(--bq-font-size--xl);
      white-space: nowrap;
    }
  `]
})
export class DefaultSideMenuComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";
</script>

<template>
  <BqSideMenu>
    <div slot="logo">
      <BqIcon name="square-logo" size="40" />
      <h1>App Name</h1>
    </div>
    <BqDivider />
    <BqSideMenuItem active>
      <BqIcon name="diamonds-four" slot="prefix" />
      Dashboard
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="package" slot="prefix" />
      Products
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
    <BqSideMenuItem disabled>
      <BqIcon name="gauge" slot="prefix" />
      Performance
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="truck" slot="prefix" />
      Deliver
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="files" slot="prefix" />
      Documents
    </BqSideMenuItem>
  </BqSideMenu>
</template>

<style>
  .app-logo {
    display: flex;
    align-items: center;
    gap: var(--bq-spacing-s);
    padding-inline: var(--bq-spacing-m);
    padding-block-start: var(--bq-spacing-m);
  }

  .app-logo svg {
    height: 2.5rem;
    width: 2.5rem;
  }

  .app-logo h1 {
    font-size: var(--bq-font-size--xl);
    white-space: nowrap;
  }
</style>
```

## Side menu item behavior

### Side menu item states

`bq-side-menu-item` is a child component, not a standalone navigation pattern. Use it only inside `bq-side-menu`.

Each item has three areas: a `bq-icon` in `slot="prefix"`, the label in the default slot, and a counter such as `bq-badge` in `slot="suffix"`. The item keeps its label on one line and truncates it with an ellipsis when the label is wider than the menu, so a row with an icon, a long name, and a count needs no truncation CSS of its own.

> [!NOTE]
>
> The full label appears in a tooltip only while the menu is collapsed. An expanded menu shows no tooltip for a truncated label, so keep labels short enough to read and show the complete name on the destination page.

Within a side menu, items support default, active, hover, focus, disabled, and with-counter states.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu>
  <bq-side-menu-item>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Default
  </bq-side-menu-item>

  <bq-side-menu-item active>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Active
  </bq-side-menu-item>

  <bq-side-menu-item disabled>
    <bq-icon name="gauge" slot="prefix"></bq-icon>
    Disabled
  </bq-side-menu-item>

  <bq-side-menu-item>
    <bq-icon name="bell" slot="prefix"></bq-icon>
    With counter
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
</bq-side-menu>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqBadge, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";

<BqSideMenu>
  <BqSideMenuItem>
    <BqIcon name="diamonds-four" slot="prefix" />
    Default
  </BqSideMenuItem>
  <BqSideMenuItem active>
    <BqIcon name="package" slot="prefix" />
    Active
  </BqSideMenuItem>
  <BqSideMenuItem disabled>
    <BqIcon name="gauge" slot="prefix" />
    Disabled
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="bell" slot="prefix" />
    With counter
    <BqBadge slot="suffix">5</BqBadge>
  </BqSideMenuItem>
</BqSideMenu>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu>
      <bq-side-menu-item>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Default
      </bq-side-menu-item>

      <bq-side-menu-item active>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Active
      </bq-side-menu-item>

      <bq-side-menu-item disabled>
        <bq-icon name="gauge" slot="prefix"></bq-icon>
        Disabled
      </bq-side-menu-item>

      <bq-side-menu-item>
        <bq-icon name="bell" slot="prefix"></bq-icon>
        With counter
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
    </bq-side-menu>
  `
})
export class SideMenuItemStatesComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqBadge, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";
</script>

<template>
  <BqSideMenu>
    <BqSideMenuItem>
      <BqIcon name="diamonds-four" slot="prefix" />
      Default
    </BqSideMenuItem>
    <BqSideMenuItem active>
      <BqIcon name="package" slot="prefix" />
      Active
    </BqSideMenuItem>
    <BqSideMenuItem disabled>
      <BqIcon name="gauge" slot="prefix" />
      Disabled
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="bell" slot="prefix" />
      With counter
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
  </BqSideMenu>
</template>
```

## Options

### Appearance

Use the `appearance` attribute to align the side menu with your application's visual language.

**Allowed `appearance` values:** `default` (default), `brand`, `inverse`.

#### Default

The default appearance is a neutral style that works well in most contexts.
It pairs with a light or dark background and uses color accents for active and hover states.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu>
  <div class="app-logo" slot="logo">
    <bq-icon name="square-logo" size="40"></bq-icon>
    <h1>App Name</h1>
  </div>
  <bq-divider></bq-divider>
  <bq-side-menu-item active>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Dashboard
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Products
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="truck" slot="prefix" ></bq-icon>
    Deliver
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="files" slot="prefix" ></bq-icon>
    Documents
  </bq-side-menu-item>
</bq-side-menu>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";

<BqSideMenu>
  <div class="app-logo" slot="logo">
    <BqIcon name="square-logo" size="40" />
    <h1>App Name</h1>
  </div>
  <BqDivider />
  <BqSideMenuItem active>
    <BqIcon name="diamonds-four" slot="prefix" />
    Dashboard
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="package" slot="prefix" />
    Products
    <BqBadge slot="suffix">5</BqBadge>
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="truck" slot="prefix" />
    Deliver
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="files" slot="prefix" />
    Documents
  </BqSideMenuItem>
</BqSideMenu>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu>
      <div class="app-logo" slot="logo">
        <bq-icon name="square-logo" size="40"></bq-icon>
        <h1>App Name</h1>
      </div>
      <bq-side-menu-item active>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Dashboard
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Products
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="truck" slot="prefix" ></bq-icon>
        Deliver
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="files" slot="prefix" ></bq-icon>
        Documents
      </bq-side-menu-item>
    </bq-side-menu>
  `
})
export class BrandSideMenuComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";
</script>

<template>
  <BqSideMenu>
    <div class="app-logo" slot="logo">
      <BqIcon name="square-logo" size="40" />
      <h1>App Name</h1>
    </div>
    <BqDivider />
    <BqSideMenuItem active>
      <BqIcon name="diamonds-four" slot="prefix" />
      Dashboard
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="package" slot="prefix" />
      Products
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="truck" slot="prefix" />
      Deliver
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="files" slot="prefix" />
      Documents
    </BqSideMenuItem>
  </BqSideMenu>
</template>
```

#### Brand

The brand appearance highlight the brand color as the background of the side menu.
This creates a strong visual presence and reinforces brand identity.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu appearance="brand">
  <div class="app-logo" slot="logo">
    <bq-icon name="square-logo" size="40"></bq-icon>
    <h1>App Name</h1>
  </div>
  <bq-divider></bq-divider>
  <bq-side-menu-item active>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Dashboard
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Products
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="truck" slot="prefix" ></bq-icon>
    Deliver
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="files" slot="prefix" ></bq-icon>
    Documents
  </bq-side-menu-item>
</bq-side-menu>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";

<BqSideMenu appearance="brand">
  <div class="app-logo" slot="logo">
    <BqIcon name="square-logo" size="40" />
    <h1>App Name</h1>
  </div>
  <BqDivider />
  <BqSideMenuItem active>
    <BqIcon name="diamonds-four" slot="prefix" />
    Dashboard
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="package" slot="prefix" />
    Products
    <BqBadge slot="suffix">5</BqBadge>
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="truck" slot="prefix" />
    Deliver
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="files" slot="prefix" />
    Documents
  </BqSideMenuItem>
</BqSideMenu>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu appearance="brand">
      <div class="app-logo" slot="logo">
        <bq-icon name="square-logo" size="40"></bq-icon>
        <h1>App Name</h1>
      </div>
      <bq-divider></bq-divider>
      <bq-side-menu-item active>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Dashboard
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Products
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="truck" slot="prefix" ></bq-icon>
        Deliver
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="files" slot="prefix" ></bq-icon>
        Documents
      </bq-side-menu-item>
    </bq-side-menu>
  `
})
export class BrandSideMenuComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";
</script>

<template>
  <BqSideMenu appearance="brand">
    <div class="app-logo" slot="logo">
      <BqIcon name="square-logo" size="40" />
      <h1>App Name</h1>
    </div>
    <BqDivider />
    <BqSideMenuItem active>
      <BqIcon name="diamonds-four" slot="prefix" />
      Dashboard
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="package" slot="prefix" />
      Products
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="truck" slot="prefix" />
      Deliver
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="files" slot="prefix" />
      Documents
    </BqSideMenuItem>
  </BqSideMenu>
</template>
```

#### Inverse

The inverse appearance is designed for use as the opposite of the BEEQ mode of the application.
For example, if your app uses `bq-mode="light"`, the inverse side menu will use the dark appearance, and vice versa.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu appearance="inverse">
  <div class="app-logo" slot="logo">
    <bq-icon name="square-logo" size="40"></bq-icon>
    <h1>App Name</h1>
  </div>
  <bq-divider></bq-divider>
  <bq-side-menu-item active>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Dashboard
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Products
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="truck" slot="prefix" ></bq-icon>
    Deliver
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="files" slot="prefix" ></bq-icon>
    Documents
  </bq-side-menu-item>
</bq-side-menu>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";

<BqSideMenu appearance="inverse">
  <div className="app-logo" slot="logo">
    <BqIcon name="square-logo" size="40" />
    <h1>App Name</h1>
  </div>
  <BqDivider />
  <BqSideMenuItem active>
    <BqIcon name="diamonds-four" slot="prefix" />
    Dashboard
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="package" slot="prefix" />
    Products
    <BqBadge slot="suffix">5</BqBadge>
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="truck" slot="prefix" />
    Deliver
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="files" slot="prefix" />
    Documents
  </BqSideMenuItem>
</BqSideMenu>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu appearance="inverse">
      <div class="app-logo" slot="logo">
        <bq-icon name="square-logo" size="40"></bq-icon>
        <h1>App Name</h1>
      </div>
      <bq-divider></bq-divider>
      <bq-side-menu-item active>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Dashboard
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Products
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="truck" slot="prefix" ></bq-icon>
        Deliver
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="files" slot="prefix" ></bq-icon>
        Documents
      </bq-side-menu-item>
    </bq-side-menu>
  `
})
export class BrandSideMenuComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";
</script>

<template>
  <BqSideMenu appearance="inverse">
    <div class="app-logo" slot="logo">
      <BqIcon name="square-logo" size="40" />
      <h1>App Name</h1>
    </div>
    <BqDivider />
    <BqSideMenuItem active>
      <BqIcon name="diamonds-four" slot="prefix" />
      Dashboard
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="package" slot="prefix" />
      Products
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="truck" slot="prefix" />
      Deliver
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="files" slot="prefix" />
      Documents
    </BqSideMenuItem>
  </BqSideMenu>
</template>
```

### Size

The side menu supports two sizes: medium (default) and small.
The small size reduces the vertical padding of the menu items for a more compact layout.
Use the `size` attribute/property to switch between the two sizes.

**Allowed `size` values:** `medium` (default), `small`.

> [!TIP]
>
> When using the medium size, there's no need to specify the `size` attribute, as it is the default.
> Default values are not required to be set explicitly, but you can add `size="medium"` for clarity if desired.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu size="small">
  <div class="app-logo" slot="logo">
    <bq-icon name="square-logo" size="40"></bq-icon>
    <h1>App Name</h1>
  </div>
  <bq-divider></bq-divider>
  <bq-side-menu-item active>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Dashboard
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Products
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="truck" slot="prefix" ></bq-icon>
    Deliver
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="files" slot="prefix" ></bq-icon>
    Documents
  </bq-side-menu-item>
</bq-side-menu>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";

<BqSideMenu size="small">
  <div class="app-logo" slot="logo">
    <BqIcon name="square-logo" size="40" />
    <h1>App Name</h1>
  </div>
  <BqDivider />
  <BqSideMenuItem active>
    <BqIcon name="diamonds-four" slot="prefix" />
    Dashboard
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="package" slot="prefix" />
    Products
    <BqBadge slot="suffix">5</BqBadge>
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="truck" slot="prefix" />
    Deliver
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="files" slot="prefix" />
    Documents
  </BqSideMenuItem>
</BqSideMenu>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu size="small">
      <div class="app-logo" slot="logo">
        <bq-icon name="square-logo" size="40"></bq-icon>
        <h1>App Name</h1>
      </div>
      <bq-divider></bq-divider>
      <bq-side-menu-item active>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Dashboard
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Products
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="truck" slot="prefix" ></bq-icon>
        Deliver
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="files" slot="prefix" ></bq-icon>
        Documents
      </bq-side-menu-item>
    </bq-side-menu>
  `,
})
export class BrandSideMenuComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";
</script>

<template>
  <BqSideMenu size="small">
    <div class="app-logo" slot="logo">
      <BqIcon name="square-logo" size="40" />
      <h1>App Name</h1>
    </div>
    <BqDivider />
    <BqSideMenuItem active>
      <BqIcon name="diamonds-four" slot="prefix" />
      Dashboard
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="package" slot="prefix" />
      Products
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="truck" slot="prefix" />
      Deliver
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="files" slot="prefix" />
      Documents
    </BqSideMenuItem>
  </BqSideMenu>
</template>
```

### With footer

Use the footer slot for supplementary actions, links, or information at the bottom of the menu.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
app-logo {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-s);
  padding-inline: var(--bq-spacing-m);
  padding-block-start: var(--bq-spacing-m);
}

app-logo svg {
  height: 2.5rem;
  width: 2.5rem;
}

app-logo h1 {
  font-size: var(--bq-font-size--l);
  white-space: nowrap;
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu>
  <div class="app-logo" slot="logo">
    <bq-icon name="square-logo" size="40"></bq-icon>
    <h1>App Name</h1>
  </div>
  <bq-divider></bq-divider>
  <bq-side-menu-item active>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Dashboard
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Products
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
  <bq-side-menu-item disabled>
    <bq-icon name="gauge" slot="prefix"></bq-icon>
    Performance
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="truck" slot="prefix" ></bq-icon>
    Deliver
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="files" slot="prefix" ></bq-icon>
    Documents
  </bq-side-menu-item>

  <div slot="footer">
    <bq-button appearance="text" label="Notifications" only-icon>
      <bq-icon name="bell" aria-hidden="true"></bq-icon>
    </bq-button>
    <bq-button appearance="text" label="Messages" only-icon>
      <bq-icon name="chats-circle" aria-hidden="true"></bq-icon>
    </bq-button>
    <bq-button appearance="text" label="Settings" only-icon>
      <bq-icon name="sliders" aria-hidden="true"></bq-icon>
    </bq-button>
  </div>
</bq-side-menu>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";
import "./styles.css";

<BqSideMenu>
  <div className="app-logo" slot="logo">
    <BqIcon name="square-logo" size="40" />
    <h1>App Name</h1>
  </div>
  <BqDivider />
  <BqSideMenuItem active>
    <BqIcon name="diamonds-four" slot="prefix" />
    Dashboard
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="package" slot="prefix" />
    Products
    <BqBadge slot="suffix">5</BqBadge>
  </BqSideMenuItem>
  <BqSideMenuItem disabled>
    <BqIcon name="gauge" slot="prefix" />
    Performance
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="truck" slot="prefix" />
    Deliver
  </BqSideMenuItem>
  <BqSideMenuItem>
    <BqIcon name="files" slot="prefix" />
    Documents
  </BqSideMenuItem>

  <div slot="footer">
    <BqButton appearance="text" label="Notifications" onlyIcon>
      <BqIcon name="bell" aria-hidden="true"></BqIcon>
    </BqButton>
    <BqButton appearance="text" label="Messages" onlyIcon>
      <BqIcon name="chats-circle" aria-hidden="true"></BqIcon>
    </BqButton>
    <BqButton appearance="text" label="Settings" onlyIcon>
      <BqIcon name="sliders" aria-hidden="true"></BqIcon>
    </BqButton>
  </div>
</BqSideMenu>
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu>
      <div class="app-logo" slot="logo">
        <bq-icon name="square-logo" size="40"></bq-icon>
        <h1>App Name</h1>
      </div>
      <bq-divider></bq-divider>
      <bq-side-menu-item active>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Dashboard
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Products
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
      <bq-side-menu-item disabled>
        <bq-icon name="gauge" slot="prefix"></bq-icon>
        Performance
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="truck" slot="prefix" ></bq-icon>
        Deliver
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="files" slot="prefix" ></bq-icon>
        Documents
      </bq-side-menu-item>

      <div slot="footer">
        <bq-button appearance="text" label="Notifications" only-icon>
          <bq-icon name="bell" aria-hidden="true"></bq-icon>
        </bq-button>
        <bq-button appearance="text" label="Messages" only-icon>
          <bq-icon name="chats-circle" aria-hidden="true"></bq-icon>
        </bq-button>
        <bq-button appearance="text" label="Settings" only-icon>
          <bq-icon name="sliders" aria-hidden="true"></bq-icon>
        </bq-button>
      </div>
    </bq-side-menu>
  `,
  styles: [`
    .app-logo {
      display: flex;
      align-items: center;
      gap: var(--bq-spacing-s);
      padding-block: var(--bq-spacing-m);
      padding-inline: var(--bq-spacing-l);
    }

    .app-logo svg {
      height: 2.5rem;
      width: 2.5rem;
    }

    .app-logo h1 {
      font-size: var(--bq-font-size--xl);
      white-space: nowrap;
    }
  `]
})
export class DefaultSideMenuComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqBadge, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";
</script>

<template>
  <BqSideMenu>
    <div class="app-logo" slot="logo">
      <BqIcon name="square-logo" size="40" />
      <h1>App Name</h1>
    </div>
    <BqDivider />
    <BqSideMenuItem active>
      <BqIcon name="diamonds-four" slot="prefix" />
      Dashboard
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="package" slot="prefix" />
      Products
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
    <BqSideMenuItem disabled>
      <BqIcon name="gauge" slot="prefix" />
      Performance
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="truck" slot="prefix" />
      Deliver
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="files" slot="prefix" />
      Documents
    </BqSideMenuItem>
  </BqSideMenu>

  <div slot="footer">
    <BqButton appearance="text" label="Notifications" onlyIcon>
      <BqIcon name="bell" aria-hidden="true"></BqIcon>
    </BqButton>
    <BqButton appearance="text" label="Messages" onlyIcon>
      <BqIcon name="chats-circle" aria-hidden="true"></BqIcon>
    </BqButton>
    <BqButton appearance="text" label="Settings" onlyIcon>
      <BqIcon name="sliders" aria-hidden="true"></BqIcon>
    </BqButton>
  </div>
</template>

<style>
  .app-logo {
    display: flex;
    align-items: center;
    gap: var(--bq-spacing-s);
    padding: var(--bq-spacing-m);
  }

  .app-logo svg {
    height: 2.5rem;
    width: 2.5rem;
  }

  .app-logo h1 {
    font-size: var(--bq-font-size--xl);
    white-space: nowrap;
  }
</style>
```

### Collapse

Use `collapse` to create a compact side menu. Collapsed menus show icons and hide labels, but the logo can be customized to show or hide based on the collapsed state.
The menu items will display their label content in a tooltip on hover when the menu is collapsed.
Wire your app control to the side menu state so the button can expand and collapse the menu. Keep the icon-only button `label` in sync with the current state.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
.app-menu[collapse] [slot="logo"] {
  padding-inline: var(--bq-spacing-xs);
}

.app-menu[collapse] [slot="logo"] h1 {
  display: none;
}

.app-menu[collapse] [slot="footer"] bq-icon[name="arrow-line-left"] {
  transform: rotate(180deg);
}

.app-menu .app-logo {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-s);
  padding: var(--bq-spacing-m);
}

.app-menu .app-logo svg {
  block-size: 2.5rem;
  inline-size: 2.5rem;
}

.app-menu .app-logo h1 {
  font-size: var(--bq-font-size--xl);
  white-space: nowrap;
}

.app-menu bq-icon[name="arrow-line-left"] {
  transition: transform 0.3s ease;
}

.app-content {
  padding: var(--bq-spacing-m);
}

.app-content h1 {
  margin-block-end: var(--bq-spacing-l);
}

.app-surface {
  block-size: 20rem;
  inline-size: 100%;
  border: 2px dashed var(--bq-color-primary);
  background-color: var(--bq-ui--alt);
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-side-menu class="app-menu" collapse>
  <div class="app-logo" slot="logo">
    <bq-icon name="square-logo" size="40"></bq-icon>
    <h1>App Name</h1>
  </div>
  <bq-divider></bq-divider>
  <bq-side-menu-item active>
    <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
    Dashboard
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="package" slot="prefix"></bq-icon>
    Products
    <bq-badge slot="suffix">5</bq-badge>
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="truck" slot="prefix" ></bq-icon>
    Deliver
  </bq-side-menu-item>
  <bq-side-menu-item>
    <bq-icon name="files" slot="prefix" ></bq-icon>
    Documents
  </bq-side-menu-item>

  <div slot="footer">
    <bq-button appearance="text" data-action="collapse" label="Expand side menu" only-icon>
      <bq-icon name="arrow-line-left"></bq-icon>
    </bq-button>
  </div>
</bq-side-menu>

<main class="app-content">
  <h1>Dashboard</h1>
  <div class="app-surface">
    <!-- Your content -->
  </div>
</main>

<script>
  (() => {
    const sideMenu = document.querySelector('.app-menu');
    const collapseButton = document.querySelector('bq-button[data-action="collapse"]');
    if (!sideMenu || !collapseButton) return;

    // Keep the icon-only button accessible as the menu state changes.
    const syncButtonLabel = () => {
      const isCollapsed = sideMenu.hasAttribute('collapse');
      collapseButton.setAttribute('label', isCollapsed ? 'Expand side menu' : 'Collapse side menu');
    };

    collapseButton.addEventListener('bqClick', async () => {
      await sideMenu.toggleCollapse();
      syncButtonLabel();
    });

    syncButtonLabel();
  })();
</script>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { useState } from "react";
import { BqBadge, BqButton, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/react";
import "./styles.css";

export function CollapsibleSideMenu() {
  const [isCollapsed, setIsCollapsed] = useState(true);
  const collapseButtonLabel = isCollapsed ? "Expand side menu" : "Collapse side menu";

  return (
    <>
      <BqSideMenu className="app-menu" collapse={isCollapsed}>
        <div className="app-logo" slot="logo">
          <BqIcon name="square-logo" size="40" />
          <h1>App Name</h1>
        </div>
        <BqDivider />
        <BqSideMenuItem active>
          <BqIcon name="diamonds-four" slot="prefix" />
          Dashboard
        </BqSideMenuItem>
        <BqSideMenuItem>
          <BqIcon name="package" slot="prefix" />
          Products
          <BqBadge slot="suffix">5</BqBadge>
        </BqSideMenuItem>
        <BqSideMenuItem>
          <BqIcon name="truck" slot="prefix" />
          Deliver
        </BqSideMenuItem>
        <BqSideMenuItem>
          <BqIcon name="files" slot="prefix" />
          Documents
        </BqSideMenuItem>

        <div slot="footer">
          <BqButton
            appearance="text"
            label={collapseButtonLabel}
            onlyIcon
            onBqClick={() => setIsCollapsed((value) => !value)}
          >
            <BqIcon name="arrow-line-left" />
          </BqButton>
        </div>
      </BqSideMenu>

      <main className="app-content">
        <h1>Dashboard</h1>
        <div className="app-surface">
          {/* Your content */}
        </div>
      </main>
    </>
  );
}
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqBadge, BqButton, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/angular/standalone";

@Component({
  standalone: true,
  imports: [BqBadge, BqButton, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem],
  template: `
    <bq-side-menu class="app-menu" [collapse]="isCollapsed">
      <div class="app-logo" slot="logo">
        <bq-icon name="square-logo" size="40"></bq-icon>
        <h1>App Name</h1>
      </div>
      <bq-divider></bq-divider>
      <bq-side-menu-item active>
        <bq-icon name="diamonds-four" slot="prefix"></bq-icon>
        Dashboard
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="package" slot="prefix"></bq-icon>
        Products
        <bq-badge slot="suffix">5</bq-badge>
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="truck" slot="prefix" ></bq-icon>
        Deliver
      </bq-side-menu-item>
      <bq-side-menu-item>
        <bq-icon name="files" slot="prefix" ></bq-icon>
        Documents
      </bq-side-menu-item>

      <div slot="footer">
        <bq-button
          appearance="text"
          only-icon
          [label]="collapseButtonLabel"
          (bqClick)="toggleSideMenu()"
        >
          <bq-icon name="arrow-line-left"></bq-icon>
        </bq-button>
      </div>
    </bq-side-menu>

    <main class="app-content">
      <h1>Dashboard</h1>
      <div class="app-surface">
        <!-- Your content -->
      </div>
    </main>
  `,
  styles: [`
    .app-menu[collapse] [slot="logo"] {
      padding-inline: var(--bq-spacing-xs);
    }

    .app-menu[collapse] [slot="logo"] h1 {
      display: none;
    }

    .app-menu[collapse] [slot="footer"] bq-icon[name="arrow-line-left"] {
      transform: rotate(180deg);
    }

    .app-menu .app-logo {
      display: flex;
      align-items: center;
      gap: var(--bq-spacing-s);
      padding: var(--bq-spacing-m);
    }

    .app-menu .app-logo svg {
      block-size: 2.5rem;
      inline-size: 2.5rem;
    }

    .app-menu .app-logo h1 {
      font-size: var(--bq-font-size--xl);
      white-space: nowrap;
    }

    .app-menu bq-icon[name="arrow-line-left"] {
      transition: transform 0.3s ease;
    }

    .app-content {
      padding: var(--bq-spacing-m);
    }

    .app-content h1 {
      margin-block-end: var(--bq-spacing-l);
    }

    .app-surface {
      block-size: 20rem;
      inline-size: 100%;
      border: 2px dashed var(--bq-color-primary);
      background-color: var(--bq-ui--alt);
    }
  `]
})
export class CollapsibleSideMenuComponent {
  isCollapsed = true;

  get collapseButtonLabel(): string {
    return this.isCollapsed ? "Expand side menu" : "Collapse side menu";
  }

  toggleSideMenu(): void {
    this.isCollapsed = !this.isCollapsed;
  }
}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { computed, ref } from "vue";
import { BqBadge, BqButton, BqDivider, BqIcon, BqSideMenu, BqSideMenuItem } from "@beeq/vue";

const isCollapsed = ref(true);
const collapseButtonLabel = computed(() => (isCollapsed.value ? "Expand side menu" : "Collapse side menu"));

const toggleSideMenu = () => {
  isCollapsed.value = !isCollapsed.value;
};
</script>

<template>
  <BqSideMenu class="app-menu" :collapse="isCollapsed">
    <div class="app-logo" slot="logo">
      <BqIcon name="square-logo" size="40" />
      <h1>App Name</h1>
    </div>
    <BqDivider />
    <BqSideMenuItem active>
      <BqIcon name="diamonds-four" slot="prefix" />
      Dashboard
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="package" slot="prefix" />
      Products
      <BqBadge slot="suffix">5</BqBadge>
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="truck" slot="prefix" />
      Deliver
    </BqSideMenuItem>
    <BqSideMenuItem>
      <BqIcon name="files" slot="prefix" />
      Documents
    </BqSideMenuItem>

    <div slot="footer">
      <BqButton appearance="text" onlyIcon :label="collapseButtonLabel" @bqClick="toggleSideMenu">
        <BqIcon name="arrow-line-left" />
      </BqButton>
    </div>
  </BqSideMenu>

  <main class="app-content">
    <h1>Dashboard</h1>
    <div class="app-surface">
      <!-- Your content -->
    </div>
  </main>
</template>

<style>
  .app-menu[collapse] [slot="logo"] {
    padding-inline: var(--bq-spacing-xs);
  }

  .app-menu[collapse] [slot="logo"] h1 {
    display: none;
  }

  .app-menu[collapse] [slot="footer"] bq-icon[name="arrow-line-left"] {
    transform: rotate(180deg);
  }

  .app-menu .app-logo {
    display: flex;
    align-items: center;
    gap: var(--bq-spacing-s);
    padding: var(--bq-spacing-m);
  }

  .app-menu .app-logo svg {
    block-size: 2.5rem;
    inline-size: 2.5rem;
  }

  .app-menu .app-logo h1 {
    font-size: var(--bq-font-size--xl);
    white-space: nowrap;
  }

  .app-menu bq-icon[name="arrow-line-left"] {
    transition: transform 0.3s ease;
  }

  .app-content {
    padding: var(--bq-spacing-m);
  }

  .app-content h1 {
    margin-block-end: var(--bq-spacing-l);
  }

  .app-surface {
    block-size: 20rem;
    inline-size: 100%;
    border: 2px dashed var(--bq-color-primary);
    background-color: var(--bq-ui--alt);
  }
</style>
```

## Best practices

> [card]
>
> Do
>
> Choose navigation titles that clearly communicate where each item leads.

> [card]
>
> Don't
>
> Avoid arbitrary titles that hide the destination or force people to guess.

> [card]
>
> Do
>
> Keep navigation labels concise by removing words that do not add meaning.

> [card]
>
> Don't
>
> Avoid long labels that wrap, truncate poorly, or reduce scanability.

> [card]
>
> Do
>
> Use sentence case for navigation items so labels read naturally.

> [card]
>
> Don't
>
> Avoid title case or all caps when they make navigation harder to scan.

> [card]
>
> Do
>
> Validate icon meaning with users when icons are needed for collapsed navigation.

> [card]
>
> Don't
>
> Do not rely on icons alone unless the destination remains understandable.

## Accessibility

The side menu renders its root surface as an `<aside>` and places menu items inside a `<nav>`. Each `bq-side-menu-item` renders as a native `<button>` with no explicit ARIA role, so it exposes the `button` role inside the `<nav>` landmark, and the `disabled` property maps to `aria-disabled="true"` and `tabindex="-1"`.

The component uses native button Tab navigation, not the composite ARIA menu keyboard pattern, so the items are not exposed as `menuitem` elements.

* **Landmark context** - you should include semantic heading text in the logo slot to communicate the menu purpose and where its content begins.
* **Collapsed state** - when you add a layout control, it must communicate the expanded or collapsed state.
* **Icons** - you should validate icon meaning when collapsed navigation relies on icons to identify destinations. You must add `aria-hidden="true"` to prefix icons: the label already names the item, and an unlabelled `bq-icon` adds its own `<name> icon` text to that name.
* **Labels** - labels must be unique and make sense without additional context. The item text feeds the collapsed tooltip content.
* **Footer actions** - every icon-only `bq-button` must have a meaningful `label`, and its decorative icon must be hidden from assistive technology.

### Keyboard interaction

Each `bq-side-menu-item` renders a native `<button>`, so there are no arrow-key shortcuts between items.

| Key | Context | Action |
| - | - | - |
| `Tab` | Any | Moves focus to the next enabled item; disabled items are skipped |
| `Shift` + `Tab` | Any | Moves focus to the previous enabled item; disabled items are skipped |
| `Enter` | Enabled, inactive item focused | Emits `bqClick` and makes the item active |
| `Space` | Enabled, inactive item focused | Emits `bqClick` and makes the item active |

### Rules

| Rule | Strength | Verified by |
| - | - | - |
| Communicate the expanded or collapsed state from any layout control you add | MUST | manual: toggle the layout control and inspect its expanded state |
| Set `aria-hidden="true"` on prefix icons | MUST | manual: inspect decorative prefix icons for aria-hidden |
| Give items unique labels that make sense without context | MUST | manual: read item names without surrounding navigation context |
| Give icon-only `bq-button` controls in the footer a meaningful `label` and hide their decorative icon | MUST | manual: inspect footer button names and decorative icons |
| Put semantic heading text in the logo slot | SHOULD | manual: read the logo-slot heading in the page outline |
| Validate icon meaning when collapsed navigation relies on icons | SHOULD | manual: ask readers to identify items from icons in collapsed mode |

## API reference

### Properties

#### `bq-side-menu`

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `appearance` | `appearance` | Sets a predefined appearance of the side menu | `'brand'` \| `'default'` \| `'inverse'` | `'default'` |
| `collapse` | `collapse` | If `true`, the container will reduce its width | `boolean` | `false` |
| `size` | `size` | Sets the size of the navigation menu items | `'medium'` \| `'small'` | `'medium'` |

#### `bq-side-menu-item`

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `active` | `active` | If `true`, the menu item will be shown as active or selected | `boolean` | `false` |
| `collapse` | `collapse` | If `true`, the item label and suffix will be hidden and the width will be reduced according to its parent | `boolean` | `false` |
| `disabled` | `disabled` | If `true`, the menu item will be disabled and no interaction is allowed | `boolean` | `false` |

### Invalid combinations

No invalid prop combinations.

### Slots

#### `bq-side-menu`

| Slot | Description |
| - | - |
| *(default)* | The main section that holds all menu items |
| `footer` | The section for adding footer content to the side menu |
| `logo` | The section for displaying the logo or brand in the side menu |

#### `bq-side-menu-item`

| Slot | Description |
| - | - |
| *(default)* | The item label. It stays on one line and truncates with an ellipsis; while collapsed, it becomes the tooltip text |
| `prefix` | Leading content, usually a `bq-icon` |
| `suffix` | Trailing content, such as a `bq-badge` counter. Hidden while collapsed |

### Shadow parts

#### `bq-side-menu`

| Part | Description |
| - | - |
| `base` | HTML `<aside>` root container |
| `footer` | HTML `<div>` element that holds the footer |
| `logo` | HTML `<div>` element that holds the logo |
| `nav` | HTML `<nav>` element that holds the navigation items |

#### `bq-side-menu-item`

| Part | Description |
| - | - |
| `base` | The native `<button>` element of the menu item |
| `panel` | The `<div>` container that holds the tooltip content when the side menu is collapsed |
| `prefix` | The prefix slot |
| `suffix` | The suffix slot |
| `trigger` | The `<div>` container that holds the element that displays the tooltip on hover when the side menu is collapsed |

### Events

#### `bq-side-menu`

| Event | Description | Type |
| - | - | - |
| `bqCollapse` | Fires when the side menu changes its width from expanded to collapsed and vice versa | `CustomEvent<{ collapse: boolean; }>` |
| `bqSelect` | Fires when the active or selected menu item changes | `CustomEvent<HTMLBqSideMenuItemElement>` |

#### `bq-side-menu-item`

| Event | Description | Type |
| - | - | - |
| `bqBlur` | Fires when the menu item loses focus | `CustomEvent<HTMLBqSideMenuItemElement>` |
| `bqClick` | Fires when the menu item is clicked | `CustomEvent<HTMLBqSideMenuItemElement>` |
| `bqFocus` | Fires when the menu item receives focus | `CustomEvent<HTMLBqSideMenuItemElement>` |

> [!NOTE]
>
> * In React, prefix events with `on`: `onBqSelect`, `onBqCollapse`, `onBqClick`.
> * In Angular, use event binding syntax: `(bqSelect)`, `(bqCollapse)`, `(bqClick)`.
> * In Vue, use the `@` shorthand: `@bqSelect`, `@bqCollapse`, `@bqClick`.

### Methods

| Method | Description | Returns |
| - | - | - |
| `toggleCollapse()` | Toggles the collapse state of the side menu | `Promise<void>` |

### CSS custom properties

#### `bq-side-menu`

| Variable | Description | Default |
| - | - | - |
| `--bq-side-menu--bg-color` | Side menu background color | `var(--bq-ui--primary)` |
| `--bq-side-menu--brand-color` | Side menu logo color | `var(--bq-ui--brand)` |
| `--bq-side-menu--border-color` | Side menu border color | `var(--bq-stroke--primary)` |
| `--bq-side-menu--footer-box-shadow` | Side menu footer box shadow | `0 -10px 12px -12px var(--bq-background--tertiary)` |

#### `bq-side-menu-item`

**CSS variables**

| Variable | Description | Default |
| - | - | - |
| `--bq-side-menu-item--bg-default` | Side menu item default background color | `transparent` |
| `--bq-side-menu-item--bg-active` | Side menu item active background color | `var(--bq-ui--brand-alt)` |
| `--bq-side-menu-item--bg-hover` | Base colour of the hover background (mixed with `--bq-hover`) | `var(--bq-ui--alt)` |
| `--bq-side-menu-item--text-default` | Side menu item default text color | `var(--bq-text--primary)` |
| `--bq-side-menu-item--text-active` | Side menu item active text color | `var(--bq-text--brand)` |
| `--bq-side-menu-item--text-hover` | Base colour of the hover text (mixed with `--bq-hover`) | `var(--bq-text--primary)` |
| `--bq-side-menu-item--paddingX` | Side menu item horizontal padding | `var(--bq-spacing-l)` |
| `--bq-side-menu-item--paddingY` | Side menu item vertical padding | `var(--bq-spacing-m)` |

> [!TIP]
>
> Learn more about [styling with shadow parts](https://www.beeq.design/guides/styles.md) and [CSS custom properties](https://www.beeq.design/theming/component-css-variables.md).

## Resources

> [card] [Interactive playground](https://storybook.beeq.design/?path=/story/components-side-menu--default)
>
> Explore all side menu configurations in Storybook

> [card] [Source code](https://github.com/Endava/BEEQ/tree/main/packages/beeq/src/components/side-menu)
>
> View the component source on GitHub


## Related topics

- [Changelog](https://www.beeq.design/releases/changelog.md)
- [Dropdown](https://www.beeq.design/components/dropdown.md)
- [Radio](https://www.beeq.design/components/radio.md)
- [Divider](https://www.beeq.design/components/divider.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.