Sidebar

A collapsible application sidebar with header, groups, menus, badges, a rail and an inset content area — shadcn/ui Sidebar for Angular.

Available in
  • Angular: available
  • Vue: available
  • React: available
  • React Native: not available yet

Usage

Library
  • 3
Developer

Use the toggle (or drag the rail) to collapse the sidebar to icons.

Import

ts
import {
  SoneSidebarComponent,
  SoneSidebarContentDirective,
  SoneSidebarFooterDirective,
  SoneSidebarGroupActionDirective,
  SoneSidebarGroupContentDirective,
  SoneSidebarGroupDirective,
  SoneSidebarGroupLabelDirective,
  SoneSidebarHeaderDirective,
  SoneSidebarInsetDirective,
  SoneSidebarMenuActionDirective,
  SoneSidebarMenuBadgeDirective,
  SoneSidebarMenuButtonDirective,
  SoneSidebarMenuDirective,
  SoneSidebarMenuItemDirective,
  SoneSidebarMenuSkeletonDirective,
  SoneSidebarMenuSubButtonDirective,
  SoneSidebarMenuSubDirective,
  SoneSidebarMenuSubItemDirective,
  SoneSidebarMenuTooltipDirective,
  SoneSidebarRailDirective,
  SoneSidebarSeparatorDirective,
  SoneSidebarTriggerDirective,
  SoneSidebarWrapperDirective,
} from "@surface-one/angular/sidebar";

API reference

SoneSidebarComponentComponent

`sidebar.css` is global, not component-scoped: the app shell must be styled before Angular boots (WKWebView cold-launch FOUC fix, see app-shell). `collapsible` defaults to `"none"`, not spartan's `"offcanvas"`: this same part is also the static section rail in the Settings dialog, which must not collapse whenever the app-wide sidebar does.

Selector
sone-sidebar
Inputs
NameType Default
sideSoneSidebarSide"left"
variantSoneSidebarVariant"sidebar"
collapsibleSoneSidebarCollapsible"none"

SoneSidebarContentDirectiveDirective

Selector
[soneSidebarContent], sone-sidebar-content

SoneSidebarFooterDirectiveDirective

Selector
[soneSidebarFooter], sone-sidebar-footer

SoneSidebarGroupActionDirectiveDirective

Selector
button[soneSidebarGroupAction]

SoneSidebarGroupContentDirectiveDirective

Selector
[soneSidebarGroupContent]

SoneSidebarGroupDirectiveDirective

Selector
[soneSidebarGroup], sone-sidebar-group
Inputs
NameType Default
tone

`danger` tints the group's label and rows red (a developer or destructive section).

SoneSidebarGroupTone"default"

SoneSidebarGroupLabelDirectiveDirective

Selector
[soneSidebarGroupLabel]
Inputs
NameType Default
variant

`destructive` sets the label in the danger colour (pair it with `destructive` menu buttons).

SoneSidebarGroupLabelVariant"default"

SoneSidebarHeaderDirectiveDirective

Selector
[soneSidebarHeader], sone-sidebar-header

SoneSidebarInsetDirectiveDirective

Selector
[soneSidebarInset]

SoneSidebarMenuActionDirectiveDirective

Selector
button[soneSidebarMenuAction]
Inputs
NameType Default
showOnHoverbooleanfalse

SoneSidebarMenuBadgeDirectiveDirective

Selector
[soneSidebarMenuBadge], sone-sidebar-menu-badge

SoneSidebarMenuButtonDirectiveDirective

Selector
button[soneSidebarMenuButton], a[soneSidebarMenuButton]
Inputs
NameType Default
sizeSoneSidebarMenuButtonSize"default"
variant

`destructive`: danger text, and the danger tint on hover and when active.

SoneSidebarMenuButtonVariant"default"
isActivebooleanfalse

SoneSidebarMenuDirectiveDirective

Selector
ul[soneSidebarMenu]
Inputs
NameType Default
orientation

`horizontal` lays the rows out as a wrapping row of content-width buttons (a narrow-screen nav).

SoneSidebarMenuOrientation"vertical"

SoneSidebarMenuItemDirectiveDirective

Selector
li[soneSidebarMenuItem]

SoneSidebarMenuSkeletonDirectiveDirective

Selector
[soneSidebarMenuSkeleton]
Inputs
NameType Default
showIconbooleanfalse

SoneSidebarMenuSubButtonDirectiveDirective

Selector
a[soneSidebarMenuSubButton], button[soneSidebarMenuSubButton]
Inputs
NameType Default
sizeSoneSidebarMenuSubButtonSize"md"
isActivebooleanfalse

SoneSidebarMenuSubDirectiveDirective

Selector
ul[soneSidebarMenuSub]

SoneSidebarMenuSubItemDirectiveDirective

Selector
li[soneSidebarMenuSubItem]

SoneSidebarMenuTooltipDirectiveDirective

Selector
[soneSidebarMenuTooltip]
Inputs
NameType Default
soneTooltipstring""
soneTooltipAlignTooltipAlign"center"
soneTooltipArrowbooleantrue
soneTooltipDisabledbooleanfalse
soneTooltipShowDelay—SHOW_DELAY_MS
soneTooltipSideTooltipSide | null"right"

SoneSidebarRailDirectiveDirective

Selector
[soneSidebarRail]
Inputs
NameType Default
resizeLabel—$localize`Resize sidebar`
toggleLabel—$localize`Toggle sidebar`
expandedHint—$localize`Click to collapse · drag to resize · ⌥-click to reset width`
collapsedHint—$localize`Click to expand`

SoneSidebarSeparatorDirectiveDirective

Selector
[soneSidebarSeparator], sone-sidebar-separator

SoneSidebarTriggerDirectiveDirective

Selector
button[soneSidebarTrigger]

SoneSidebarWrapperDirectiveDirective

⌘B/Ctrl+B also toggles Bold in `sone-markdown-editor`, which calls `preventDefault()` on the textarea before this document-level listener runs, so it stands down there and never fires inside any editable field.

Selector
[soneSidebarWrapper], sone-sidebar-wrapper
Inputs
NameType Default
sidebarWidthstring | nullnull
sidebarWidthIconstring | nullnull