Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sidebar

Sidebar is a resizable side panel with header, scrollable content, and footer sections.

When To Use It

Use Sidebar for persistent navigation, inspector panes, or contextual utility panels that should be resizable by the user.

Constructing a Sidebar

use vizia::prelude::*;

Sidebar::new(
    cx,
    |cx| Label::new(cx, "Navigation"),
    |cx| {
        VStack::new(cx, |cx| {
            Label::new(cx, "Home");
            Label::new(cx, "Settings");
        });
    },
    |cx| Label::new(cx, "v1.0.0"),
);
  • Constructor: Sidebar::new(cx, header, content, footer)
  • Uses Resizable internally for width resizing.

Components and Styling

SelectorDescription
sidebarRoot sidebar element.
sidebar .sidebar-headerHeader section.
sidebar .sidebar-contentScrollable content section.
sidebar .sidebar-footerFooter section.
sidebar .sidebar-dividerDivider between sections.

Accessibility

Keep section content clearly labeled (especially in header) so users can understand sidebar purpose and region boundaries quickly.