Sidebar

Uma barra lateral de aplicativo recolhível com cabeçalho, grupos, menus, badges, rail e área de conteúdo recuada — o Sidebar do shadcn/ui para Angular.

Disponível em
  • Angular: disponível
  • Vue: disponível
  • React: disponível
  • React Native: ainda não disponível

Uso

Library
  • 3
Developer

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

Importação

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";

Referência da API

SoneSidebarComponentComponente

`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.

Seletor
sone-sidebar
Inputs
NomeTipo Padrão
sideSoneSidebarSide"left"
variantSoneSidebarVariant"sidebar"
collapsibleSoneSidebarCollapsible"none"

SoneSidebarContentDirectiveDiretiva

Seletor
[soneSidebarContent], sone-sidebar-content

SoneSidebarFooterDirectiveDiretiva

Seletor
[soneSidebarFooter], sone-sidebar-footer

SoneSidebarGroupActionDirectiveDiretiva

Seletor
button[soneSidebarGroupAction]

SoneSidebarGroupContentDirectiveDiretiva

Seletor
[soneSidebarGroupContent]

SoneSidebarGroupDirectiveDiretiva

Seletor
[soneSidebarGroup], sone-sidebar-group
Inputs
NomeTipo Padrão
tone

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

SoneSidebarGroupTone"default"

SoneSidebarGroupLabelDirectiveDiretiva

Seletor
[soneSidebarGroupLabel]
Inputs
NomeTipo Padrão
variant

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

SoneSidebarGroupLabelVariant"default"

SoneSidebarHeaderDirectiveDiretiva

Seletor
[soneSidebarHeader], sone-sidebar-header

SoneSidebarInsetDirectiveDiretiva

Seletor
[soneSidebarInset]

SoneSidebarMenuActionDirectiveDiretiva

Seletor
button[soneSidebarMenuAction]
Inputs
NomeTipo Padrão
showOnHoverbooleanfalse

SoneSidebarMenuBadgeDirectiveDiretiva

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

SoneSidebarMenuButtonDirectiveDiretiva

Seletor
button[soneSidebarMenuButton], a[soneSidebarMenuButton]
Inputs
NomeTipo Padrão
sizeSoneSidebarMenuButtonSize"default"
variant

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

SoneSidebarMenuButtonVariant"default"
isActivebooleanfalse

SoneSidebarMenuDirectiveDiretiva

Seletor
ul[soneSidebarMenu]
Inputs
NomeTipo Padrão
orientation

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

SoneSidebarMenuOrientation"vertical"

SoneSidebarMenuItemDirectiveDiretiva

Seletor
li[soneSidebarMenuItem]

SoneSidebarMenuSkeletonDirectiveDiretiva

Seletor
[soneSidebarMenuSkeleton]
Inputs
NomeTipo Padrão
showIconbooleanfalse

SoneSidebarMenuSubButtonDirectiveDiretiva

Seletor
a[soneSidebarMenuSubButton], button[soneSidebarMenuSubButton]
Inputs
NomeTipo Padrão
sizeSoneSidebarMenuSubButtonSize"md"
isActivebooleanfalse

SoneSidebarMenuSubDirectiveDiretiva

Seletor
ul[soneSidebarMenuSub]

SoneSidebarMenuSubItemDirectiveDiretiva

Seletor
li[soneSidebarMenuSubItem]

SoneSidebarMenuTooltipDirectiveDiretiva

Seletor
[soneSidebarMenuTooltip]
Inputs
NomeTipo Padrão
soneTooltipstring""
soneTooltipAlignTooltipAlign"center"
soneTooltipArrowbooleantrue
soneTooltipDisabledbooleanfalse
soneTooltipShowDelay—SHOW_DELAY_MS
soneTooltipSideTooltipSide | null"right"

SoneSidebarRailDirectiveDiretiva

Seletor
[soneSidebarRail]
Inputs
NomeTipo Padrão
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`

SoneSidebarSeparatorDirectiveDiretiva

Seletor
[soneSidebarSeparator], sone-sidebar-separator

SoneSidebarTriggerDirectiveDiretiva

Seletor
button[soneSidebarTrigger]

SoneSidebarWrapperDirectiveDiretiva

⌘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.

Seletor
[soneSidebarWrapper], sone-sidebar-wrapper
Inputs
NomeTipo Padrão
sidebarWidthstring | nullnull
sidebarWidthIconstring | nullnull