FriendChise Docs
Sidebars
Context-driven page sidebar and action sidebar patterns
The sidebar system is one of the most important app patterns. It is split into two layers on purpose so navigation and editing do not fight each other.
Page sidebar
PageSidebarContextstores aReactNodefor the current page sidebar, plus its title, sub-content, and collapsed state.- Pages register sidebar content through
RegisterPageSidebarorRegisterPageSidebarSubContentinstead of passing props through every layout. - This sidebar is for persistent navigation, filtering, and view controls.
- It is not where the main mutation form should live.
- The shell stays mounted while only the inner content changes, which avoids flicker during navigation.
- On desktop it can collapse into a narrow slot; on mobile it becomes a fixed overlay.
Action sidebar
ActionSidebarContextstores a single active panel with a title and content.- Any client component can open it through
useActionSidebar().open(...). - It is used for create, edit, and detail flows that should feel focused but stay inside the page.
- This sidebar is for changing data or working through a task, not for primary navigation.
- On desktop it renders inline beside the page sidebar; on mobile it becomes a bottom sheet.
Why both exist
PageSidebaris for persistent navigation, filters, and view state.ActionSidebaris for temporary tasks, focused forms, and data changes.- Splitting them keeps the app from turning every sidebar action into a full route change.
Shared nav items
SidebarNavItemis the base nav row used by both app and page sidebars.- It has two variants:
appfor the compact global sidebar andpagefor wider page sidebars. PageSidebarNavItemis just a convenience wrapper for the page variant.
Mobile behavior
- The global sidebar uses a mobile context so the hamburger button can open and close it.
- The page sidebar and action sidebar both switch to mobile-friendly overlays instead of shrinking into unusable columns.
- That keeps the same structure on small screens without forcing tiny click targets.
Mental model
PageSidebarhelps you move around or change how you are looking at a page.ActionSidebarhelps you do the actual work.- If the panel changes the page's state or filters, it probably belongs in
PageSidebar. - If the panel creates, edits, or inspects a specific thing, it probably belongs in
ActionSidebar.
