# Sidebar

- Entry point: `@koobiq/components/sidebar`
- NgModule: `KbqSidebarModule`
- API: https://koobiq.io/api/sidebar.md
- Page: https://koobiq.io/en/components/sidebar/overview

## Overview

Component designed to add collapsible side content.

[**Example: Sidebar overview** (`sidebar-overview`)](https://koobiq.io/examples/sidebar-overview.md)

### State Saving

The sidebar remembers whether it was open and the width it was closed at, and restores the state after a page reload. On by default — use `[useStateSaving]="false"` to turn it off on a specific component.

[**Example: Sidebar state saving** (`sidebar-state-saving`)](https://koobiq.io/examples/sidebar-state-saving.md)

Nothing is persisted while `opened` is bound — a binding there means the application decides. A sidebar that should remember its own state is left uncontrolled and toggled through `toggle()` or the `[` / `]` shortcut.

`clearSavedState()` removes what is stored.

Keys, storage and expiry work the same for every component that persists — see [Saving component state](https://koobiq.io/en/components/core.md#saving-component-state).

### Keyboard interaction

| Key | Action                   |
| --- | ------------------------ |
| \[  | Open/close left Sidebar  |
| ]   | Open/close right Sidebar |

## Examples

### With splitter

[**Example: Sidebar with splitter** (`sidebar-with-splitter`)](https://koobiq.io/examples/sidebar-with-splitter.md)
