Sidebar

ヘッダー、グループ、メニュー、バッジ、レール、インセットのコンテンツ領域を備えた折りたたみ可能なアプリケーションサイドバー。Angular 版の shadcn/ui Sidebar です。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 未対応

使い方

Library
  • 3
Developer

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

インポート

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 リファレンス

SoneSidebarComponentコンポーネント

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

セレクター
sone-sidebar
入力
名前型 デフォルト
sideSoneSidebarSide"left"
variantSoneSidebarVariant"sidebar"
collapsibleSoneSidebarCollapsible"none"

SoneSidebarContentDirectiveディレクティブ

セレクター
[soneSidebarContent], sone-sidebar-content

SoneSidebarFooterDirectiveディレクティブ

セレクター
[soneSidebarFooter], sone-sidebar-footer

SoneSidebarGroupActionDirectiveディレクティブ

セレクター
button[soneSidebarGroupAction]

SoneSidebarGroupContentDirectiveディレクティブ

セレクター
[soneSidebarGroupContent]

SoneSidebarGroupDirectiveディレクティブ

セレクター
[soneSidebarGroup], sone-sidebar-group
入力
名前型 デフォルト
tone

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

SoneSidebarGroupTone"default"

SoneSidebarGroupLabelDirectiveディレクティブ

セレクター
[soneSidebarGroupLabel]
入力
名前型 デフォルト
variant

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

SoneSidebarGroupLabelVariant"default"

SoneSidebarHeaderDirectiveディレクティブ

セレクター
[soneSidebarHeader], sone-sidebar-header

SoneSidebarInsetDirectiveディレクティブ

セレクター
[soneSidebarInset]

SoneSidebarMenuActionDirectiveディレクティブ

セレクター
button[soneSidebarMenuAction]
入力
名前型 デフォルト
showOnHoverbooleanfalse

SoneSidebarMenuBadgeDirectiveディレクティブ

セレクター
[soneSidebarMenuBadge], sone-sidebar-menu-badge

SoneSidebarMenuButtonDirectiveディレクティブ

セレクター
button[soneSidebarMenuButton], a[soneSidebarMenuButton]
入力
名前型 デフォルト
sizeSoneSidebarMenuButtonSize"default"
variant

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

SoneSidebarMenuButtonVariant"default"
isActivebooleanfalse

SoneSidebarMenuDirectiveディレクティブ

セレクター
ul[soneSidebarMenu]
入力
名前型 デフォルト
orientation

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

SoneSidebarMenuOrientation"vertical"

SoneSidebarMenuItemDirectiveディレクティブ

セレクター
li[soneSidebarMenuItem]

SoneSidebarMenuSkeletonDirectiveディレクティブ

セレクター
[soneSidebarMenuSkeleton]
入力
名前型 デフォルト
showIconbooleanfalse

SoneSidebarMenuSubButtonDirectiveディレクティブ

セレクター
a[soneSidebarMenuSubButton], button[soneSidebarMenuSubButton]
入力
名前型 デフォルト
sizeSoneSidebarMenuSubButtonSize"md"
isActivebooleanfalse

SoneSidebarMenuSubDirectiveディレクティブ

セレクター
ul[soneSidebarMenuSub]

SoneSidebarMenuSubItemDirectiveディレクティブ

セレクター
li[soneSidebarMenuSubItem]

SoneSidebarMenuTooltipDirectiveディレクティブ

セレクター
[soneSidebarMenuTooltip]
入力
名前型 デフォルト
soneTooltipstring""
soneTooltipAlignTooltipAlign"center"
soneTooltipArrowbooleantrue
soneTooltipDisabledbooleanfalse
soneTooltipShowDelay—SHOW_DELAY_MS
soneTooltipSideTooltipSide | null"right"

SoneSidebarRailDirectiveディレクティブ

セレクター
[soneSidebarRail]
入力
名前型 デフォルト
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`

SoneSidebarSeparatorDirectiveディレクティブ

セレクター
[soneSidebarSeparator], sone-sidebar-separator

SoneSidebarTriggerDirectiveディレクティブ

セレクター
button[soneSidebarTrigger]

SoneSidebarWrapperDirectiveディレクティブ

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

セレクター
[soneSidebarWrapper], sone-sidebar-wrapper
入力
名前型 デフォルト
sidebarWidthstring | nullnull
sidebarWidthIconstring | nullnull