---
title: "Channel sidebar"
description: "The column a server is navigated from: its name, its channels as a tree and the user panel at the foot."
---

The navigation column of a chat-shaped app, assembled from the registry: the server's name, its categories and channels as a [Tree](/docs/components/tree), and the signed-in user's [User Panel](/docs/components/user-panel) pinned to the bottom. The channel list scrolls; the header and the panel stay put.

Give it a height, and pair it with the [Chat window](/docs/components/chat-window) block for a whole screen.

_Live example of Channel sidebar — see the page for the rendered demo._

## Installation

```bash
npx newtui@latest add channel-sidebar
``` Registry dependencies, installed with it: tree, user-panel, status-indicator, avatar.

Files written — React: components/channel-sidebar.tsx. Vue: components/channel-sidebar/ChannelSidebar.vue, components/channel-sidebar/types.ts, components/channel-sidebar/index.ts.

## Usage

React:

```tsx
import { ChannelSidebar } from "@/components/channel-sidebar"
```

Vue:

```ts
import { ChannelSidebar } from "@/components/channel-sidebar"
```

## API reference

**`ChannelSidebar`**

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `serverName` | `string` | — | Shown in the header and used to name the region. |
| `channels` | `TreeNode[]` | — | Categories and their channels, in the shape the tree takes. |
| `defaultExpanded` | `string[]` | — | Ids of the categories that start open. |
| `channel / v-model:channel` | `string` | — | The id of the channel being shown. |
| `onChannelChange` | `(channel: string) => void` | — | React only. Called when a channel is chosen; Vue emits `update:channel`. |
| `user` | `{ name: string; initials: string; status: Status; statusText?: string }` | — | The signed-in user, for the panel at the foot. |
| `onOpenSettings / @open-settings` | `() => void` | — | Called when the settings button in the user panel is pressed. |

Mute and deafen are local state inside the block, because it has no voice connection to tell. When yours does, copy the block and lift those two values out.

## Accessibility

The column is an `<aside>` named after the server. Inside it the channels are one tab stop with the tree's arrow-key model, and the user panel's buttons follow in the tab order. See the Tree and User Panel pages for the detail of each.

## Tokens

Channel sidebar reads its colours, radii and motion from the `--newt-*` tokens. Override a token rather than editing the component.
