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

# Sidebar

> Import and use the Sidebar components from @pharen/ui.

export const PharenUiPreview = ({name, title = 'Pharen UI component preview'}) => <div className="not-prose my-6 overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm dark:border-white/10 dark:bg-zinc-950">
    <div className="pharen-ui-preview-root" data-pharen-ui-preview data-example={name} role="region" aria-label={title} />
  </div>;

Use **Sidebar** to build an application sidebar with responsive behavior. This page covers every Vue component exported by the public module.

<PharenUiPreview name="sidebar" title="Sidebar preview" />

<Accordion title="View code">
  ```vue theme={null}
  <script setup lang="ts">
  import { Sidebar, SidebarContent, SidebarHeader, SidebarInset, SidebarProvider, SidebarTrigger } from '@pharen/ui';
  </script>

  <template>
    <SidebarProvider>
      <Sidebar>
        <SidebarHeader>Pharen</SidebarHeader>
        <SidebarContent>Navigation</SidebarContent>
      </Sidebar>
      <SidebarInset>
        <SidebarTrigger />
        <main>Page content</main>
      </SidebarInset>
    </SidebarProvider>
  </template>
  ```
</Accordion>

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @pharen/ui
  ```

  ```bash pnpm theme={null}
  pnpm add @pharen/ui
  ```

  ```bash yarn theme={null}
  yarn add @pharen/ui
  ```

  ```bash bun theme={null}
  bun add @pharen/ui
  ```
</CodeGroup>

<Note>
  Import `@pharen/ui/styles.css` exactly once in your application entrypoint.
</Note>

## Usage

```ts theme={null}
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger } from '@pharen/ui';
```

## Exports

| Export                 | Purpose                                  |
| ---------------------- | ---------------------------------------- |
| `Sidebar`              | Exported Vue component from this module. |
| `SidebarContent`       | Contains the visible content.            |
| `SidebarFooter`        | Structures the footer region.            |
| `SidebarGroup`         | Groups related items.                    |
| `SidebarGroupAction`   | Exported Vue component from this module. |
| `SidebarGroupContent`  | Contains the visible content.            |
| `SidebarGroupLabel`    | Labels a value or region.                |
| `SidebarHeader`        | Structures the header region.            |
| `SidebarInput`         | Exported Vue component from this module. |
| `SidebarInset`         | Exported Vue component from this module. |
| `SidebarMenu`          | Exported Vue component from this module. |
| `SidebarMenuAction`    | Exported Vue component from this module. |
| `SidebarMenuBadge`     | Exported Vue component from this module. |
| `SidebarMenuButton`    | Exported Vue component from this module. |
| `SidebarMenuItem`      | Represents one item.                     |
| `SidebarMenuSkeleton`  | Exported Vue component from this module. |
| `SidebarMenuSub`       | Exported Vue component from this module. |
| `SidebarMenuSubButton` | Exported Vue component from this module. |
| `SidebarMenuSubItem`   | Represents one item.                     |
| `SidebarProvider`      | Exported Vue component from this module. |
| `SidebarRail`          | Exported Vue component from this module. |
| `SidebarSeparator`     | Separates adjacent regions.              |
| `SidebarTrigger`       | Opens or activates the component.        |

## Source

[Open the source on GitHub](https://github.com/PharenIT/ELEV8-Labs/tree/main/src/packages/ui/src/components/sidebar)
