Skip to main content
Start from a working Neo app shell, then wrap your nested AutoRouter with NeoSidebarLayout as shown below.

Example

Properties

Required

List<Widget>
required
The list of widgets to display in the sidebar. While you have full flexibility, most of the time this will be NeoSidebarButton widgets. You can also include other widgets like a logo, workspace dropdown, progress card, etc.
Widget
required
The main content widget that will be displayed alongside the sidebar. Typically const AutoRouter() when using Neo’s recommended routing approach, but can be any widget that represents your main content area.

State Management

The sidebar layout uses Riverpod providers to manage its state:
StateNotifierProvider
Controls the sidebar’s visibility and collapse state. Access via ref.watch() or ref.read().

Available State Methods

Platform Behavior

  • Swipe gestures: Control collapse/expand state
  • Content behavior: Main content area scales horizontally when collapsing/expanding
  • Swipe gestures: Control hide/show state
  • Content behavior: Content slides slightly offscreen to make room for sidebar

Best Practices

  • Use child: const AutoRouter() for nested routing.
  • Wrap the page in Container(color: theme.colors.bgPrimary), then NeoSafeArea, then the page content.

Behavior

  • The layout does not store which item is active. Set isActive on each NeoSidebarButton from the current route.
Route-based active state
Last modified on September 30, 2026