Open History to see the last commit
1import { Slot } from "@radix-ui/react-slot";
2import { cva, type VariantProps } from "class-variance-authority";
3import { PanelLeftIcon } from "lucide-react";
4import {
5 type ComponentProps,
6 type CSSProperties,
7 createContext,
8 useCallback,
9 useContext,
10 useEffect,
11 useMemo,
12 useState,
13} from "react";
14import { Button } from "@/components/ui/button";
15import { Input } from "@/components/ui/input";
16import { Separator } from "@/components/ui/separator";
17import {
18 Sheet,
19 SheetContent,
20 SheetDescription,
21 SheetHeader,
22 SheetTitle,
23} from "@/components/ui/sheet";
24import { Skeleton } from "@/components/ui/skeleton";
25import {
26 Tooltip,
27 TooltipContent,
28 TooltipProvider,
29 TooltipTrigger,
30} from "@/components/ui/tooltip";
31import { useIsMobile } from "@/hooks/use-mobile";
32import { cn } from "@/lib/utils";
33
34const SIDEBAR_COOKIE_NAME = "sidebar_state";
35const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
36const SIDEBAR_WIDTH = "16rem";
37const SIDEBAR_WIDTH_MOBILE = "18rem";
38const SIDEBAR_WIDTH_ICON = "3rem";
39const SIDEBAR_KEYBOARD_SHORTCUT = "b";
40
41type SidebarContextProps = {
42 state: "expanded" | "collapsed";
43 open: boolean;
44 setOpen: (open: boolean) => void;
45 openMobile: boolean;
46 setOpenMobile: (open: boolean) => void;
47 isMobile: boolean;
48 toggleSidebar: () => void;
49};
50
51const SidebarContext = createContext<SidebarContextProps | null>(null);
52
53function useSidebar() {
54 const context = useContext(SidebarContext);
55 if (!context) {
56 throw new Error("useSidebar must be used within a SidebarProvider.");
57 }
58
59 return context;
60}
61
62function SidebarProvider({
63 defaultOpen = true,
64 open: openProp,
65 onOpenChange: setOpenProp,
66 className,
67 style,
68 children,
69 ...props
70}: ComponentProps<"div"> & {
71 defaultOpen?: boolean;
72 open?: boolean;
73 onOpenChange?: (open: boolean) => void;
74}) {
75 const isMobile = useIsMobile();
76 const [openMobile, setOpenMobile] = useState(false);
77
78 // This is the internal state of the sidebar.
79 // We use openProp and setOpenProp for control from outside the component.
80 const [_open, _setOpen] = useState(defaultOpen);
81 const open = openProp ?? _open;
82 const setOpen = useCallback(
83 (value: boolean | ((value: boolean) => boolean)) => {
84 const openState = typeof value === "function" ? value(open) : value;
85 if (setOpenProp) {
86 setOpenProp(openState);
87 } else {
88 _setOpen(openState);
89 }
90
91 // This sets the cookie to keep the sidebar state.
92 document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
93 },
94 [setOpenProp, open],
95 );
96
97 // Helper to toggle the sidebar.
98 const toggleSidebar = useCallback(() => {
99 return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
100 }, [isMobile, setOpen]);
101
102 // Adds a keyboard shortcut to toggle the sidebar.
103 useEffect(() => {
104 const handleKeyDown = (event: KeyboardEvent) => {
105 if (
106 event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
107 (event.metaKey || event.ctrlKey)
108 ) {
109 event.preventDefault();
110 toggleSidebar();
111 }
112 };
113
114 window.addEventListener("keydown", handleKeyDown);
115 return () => window.removeEventListener("keydown", handleKeyDown);
116 }, [toggleSidebar]);
117
118 // We add a state so that we can do data-state="expanded" or "collapsed".
119 // This makes it easier to style the sidebar with Tailwind classes.
120 const state = open ? "expanded" : "collapsed";
121
122 const contextValue = useMemo<SidebarContextProps>(
123 () => ({
124 state,
125 open,
126 setOpen,
127 isMobile,
128 openMobile,
129 setOpenMobile,
130 toggleSidebar,
131 }),
132 [state, open, setOpen, isMobile, openMobile, toggleSidebar],
133 );
134
135 return (
136 <SidebarContext.Provider value={contextValue}>
137 <TooltipProvider delayDuration={0}>
138 <div
139 data-slot="sidebar-wrapper"
140 style={
141 {
142 "--sidebar-width": SIDEBAR_WIDTH,
143 "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
144 ...style,
145 } as CSSProperties
146 }
147 className={cn(
148 "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
149 className,
150 )}
151 {...props}
152 >
153 {children}
154 </div>
155 </TooltipProvider>
156 </SidebarContext.Provider>
157 );
158}
159
160function Sidebar({
161 side = "left",
162 variant = "sidebar",
163 collapsible = "offcanvas",
164 className,
165 children,
166 ...props
167}: ComponentProps<"div"> & {
168 side?: "left" | "right";
169 variant?: "sidebar" | "floating" | "inset";
170 collapsible?: "offcanvas" | "icon" | "none";
171}) {
172 const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
173
174 if (collapsible === "none") {
175 return (
176 <div
177 data-slot="sidebar"
178 className={cn(
179 "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
180 className,
181 )}
182 {...props}
183 >
184 {children}
185 </div>
186 );
187 }
188
189 if (isMobile) {
190 return (
191 <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
192 <SheetContent
193 data-sidebar="sidebar"
194 data-slot="sidebar"
195 data-mobile="true"
196 className="bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
197 style={
198 {
199 "--sidebar-width": SIDEBAR_WIDTH_MOBILE,
200 } as CSSProperties
201 }
202 side={side}
203 >
204 <SheetHeader className="sr-only">
205 <SheetTitle>Sidebar</SheetTitle>
206 <SheetDescription>Displays the mobile sidebar.</SheetDescription>
207 </SheetHeader>
208 <div className="flex h-full w-full flex-col">{children}</div>
209 </SheetContent>
210 </Sheet>
211 );
212 }
213
214 return (
215 <div
216 className="group peer text-sidebar-foreground hidden md:block"
217 data-state={state}
218 data-collapsible={state === "collapsed" ? collapsible : ""}
219 data-variant={variant}
220 data-side={side}
221 data-slot="sidebar"
222 >
223 {/* This is what handles the sidebar gap on desktop */}
224 <div
225 data-slot="sidebar-gap"
226 className={cn(
227 "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
228 "group-data-[collapsible=offcanvas]:w-0",
229 "group-data-[side=right]:rotate-180",
230 variant === "floating" || variant === "inset"
231 ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
232 : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",
233 )}
234 />
235 <div
236 data-slot="sidebar-container"
237 className={cn(
238 "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
239 side === "left"
240 ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
241 : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
242 // Adjust the padding for floating and inset variants.
243 variant === "floating" || variant === "inset"
244 ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
245 : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
246 className,
247 )}
248 {...props}
249 >
250 <div
251 data-sidebar="sidebar"
252 data-slot="sidebar-inner"
253 className="bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm"
254 >
255 {children}
256 </div>
257 </div>
258 </div>
259 );
260}
261
262function SidebarTrigger({
263 className,
264 onClick,
265 ...props
266}: ComponentProps<typeof Button>) {
267 const { toggleSidebar } = useSidebar();
268
269 return (
270 <Button
271 data-sidebar="trigger"
272 data-slot="sidebar-trigger"
273 variant="ghost"
274 size="icon"
275 className={cn("size-7", className)}
276 onClick={(event) => {
277 onClick?.(event);
278 toggleSidebar();
279 }}
280 {...props}
281 >
282 <PanelLeftIcon />
283 <span className="sr-only">Toggle Sidebar</span>
284 </Button>
285 );
286}
287
288function SidebarRail({ className, ...props }: ComponentProps<"button">) {
289 const { toggleSidebar } = useSidebar();
290
291 return (
292 <button
293 data-sidebar="rail"
294 data-slot="sidebar-rail"
295 aria-label="Toggle Sidebar"
296 tabIndex={-1}
297 onClick={toggleSidebar}
298 title="Toggle Sidebar"
299 className={cn(
300 "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
301 "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
302 "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
303 "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
304 "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
305 "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
306 className,
307 )}
308 {...props}
309 />
310 );
311}
312
313function SidebarInset({ className, ...props }: ComponentProps<"main">) {
314 return (
315 <main
316 data-slot="sidebar-inset"
317 className={cn(
318 "bg-background relative flex w-full flex-1 flex-col",
319 "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
320 className,
321 )}
322 {...props}
323 />
324 );
325}
326
327function SidebarInput({ className, ...props }: ComponentProps<typeof Input>) {
328 return (
329 <Input
330 data-slot="sidebar-input"
331 data-sidebar="input"
332 className={cn("bg-background h-8 w-full shadow-none", className)}
333 {...props}
334 />
335 );
336}
337
338function SidebarHeader({ className, ...props }: ComponentProps<"div">) {
339 return (
340 <div
341 data-slot="sidebar-header"
342 data-sidebar="header"
343 className={cn("flex flex-col gap-2 p-2", className)}
344 {...props}
345 />
346 );
347}
348
349function SidebarFooter({ className, ...props }: ComponentProps<"div">) {
350 return (
351 <div
352 data-slot="sidebar-footer"
353 data-sidebar="footer"
354 className={cn("flex flex-col gap-2 p-2", className)}
355 {...props}
356 />
357 );
358}
359
360function SidebarSeparator({
361 className,
362 ...props
363}: ComponentProps<typeof Separator>) {
364 return (
365 <Separator
366 data-slot="sidebar-separator"
367 data-sidebar="separator"
368 className={cn("bg-sidebar-border mx-2 w-auto", className)}
369 {...props}
370 />
371 );
372}
373
374function SidebarContent({ className, ...props }: ComponentProps<"div">) {
375 return (
376 <div
377 data-slot="sidebar-content"
378 data-sidebar="content"
379 className={cn(
380 "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
381 className,
382 )}
383 {...props}
384 />
385 );
386}
387
388function SidebarGroup({ className, ...props }: ComponentProps<"div">) {
389 return (
390 <div
391 data-slot="sidebar-group"
392 data-sidebar="group"
393 className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
394 {...props}
395 />
396 );
397}
398
399function SidebarGroupLabel({
400 className,
401 asChild = false,
402 ...props
403}: ComponentProps<"div"> & { asChild?: boolean }) {
404 const Comp = asChild ? Slot : "div";
405
406 return (
407 <Comp
408 data-slot="sidebar-group-label"
409 data-sidebar="group-label"
410 className={cn(
411 "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
412 "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
413 className,
414 )}
415 {...props}
416 />
417 );
418}
419
420function SidebarGroupAction({
421 className,
422 asChild = false,
423 ...props
424}: ComponentProps<"button"> & { asChild?: boolean }) {
425 const Comp = asChild ? Slot : "button";
426
427 return (
428 <Comp
429 data-slot="sidebar-group-action"
430 data-sidebar="group-action"
431 className={cn(
432 "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
433 // Increases the hit area of the button on mobile.
434 "after:absolute after:-inset-2 md:after:hidden",
435 "group-data-[collapsible=icon]:hidden",
436 className,
437 )}
438 {...props}
439 />
440 );
441}
442
443function SidebarGroupContent({ className, ...props }: ComponentProps<"div">) {
444 return (
445 <div
446 data-slot="sidebar-group-content"
447 data-sidebar="group-content"
448 className={cn("w-full text-sm", className)}
449 {...props}
450 />
451 );
452}
453
454function SidebarMenu({ className, ...props }: ComponentProps<"ul">) {
455 return (
456 <ul
457 data-slot="sidebar-menu"
458 data-sidebar="menu"
459 className={cn("flex w-full min-w-0 flex-col gap-1", className)}
460 {...props}
461 />
462 );
463}
464
465function SidebarMenuItem({ className, ...props }: ComponentProps<"li">) {
466 return (
467 <li
468 data-slot="sidebar-menu-item"
469 data-sidebar="menu-item"
470 className={cn("group/menu-item relative", className)}
471 {...props}
472 />
473 );
474}
475
476const sidebarMenuButtonVariants = cva(
477 "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
478 {
479 variants: {
480 variant: {
481 default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
482 outline:
483 "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
484 },
485 size: {
486 default: "h-8 text-sm",
487 sm: "h-7 text-xs",
488 lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
489 },
490 },
491 defaultVariants: {
492 variant: "default",
493 size: "default",
494 },
495 },
496);
497
498function SidebarMenuButton({
499 asChild = false,
500 isActive = false,
501 variant = "default",
502 size = "default",
503 tooltip,
504 className,
505 ...props
506}: ComponentProps<"button"> & {
507 asChild?: boolean;
508 isActive?: boolean;
509 tooltip?: string | ComponentProps<typeof TooltipContent>;
510} & VariantProps<typeof sidebarMenuButtonVariants>) {
511 const Comp = asChild ? Slot : "button";
512 const { isMobile, state } = useSidebar();
513
514 const button = (
515 <Comp
516 data-slot="sidebar-menu-button"
517 data-sidebar="menu-button"
518 data-size={size}
519 data-active={isActive}
520 className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
521 {...props}
522 />
523 );
524
525 if (!tooltip) {
526 return button;
527 }
528
529 if (typeof tooltip === "string") {
530 tooltip = {
531 children: tooltip,
532 };
533 }
534
535 return (
536 <Tooltip>
537 <TooltipTrigger asChild>{button}</TooltipTrigger>
538 <TooltipContent
539 side="right"
540 align="center"
541 hidden={state !== "collapsed" || isMobile}
542 {...tooltip}
543 />
544 </Tooltip>
545 );
546}
547
548function SidebarMenuAction({
549 className,
550 asChild = false,
551 showOnHover = false,
552 ...props
553}: ComponentProps<"button"> & {
554 asChild?: boolean;
555 showOnHover?: boolean;
556}) {
557 const Comp = asChild ? Slot : "button";
558
559 return (
560 <Comp
561 data-slot="sidebar-menu-action"
562 data-sidebar="menu-action"
563 className={cn(
564 "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
565 // Increases the hit area of the button on mobile.
566 "after:absolute after:-inset-2 md:after:hidden",
567 "peer-data-[size=sm]/menu-button:top-1",
568 "peer-data-[size=default]/menu-button:top-1.5",
569 "peer-data-[size=lg]/menu-button:top-2.5",
570 "group-data-[collapsible=icon]:hidden",
571 showOnHover &&
572 "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
573 className,
574 )}
575 {...props}
576 />
577 );
578}
579
580function SidebarMenuBadge({ className, ...props }: ComponentProps<"div">) {
581 return (
582 <div
583 data-slot="sidebar-menu-badge"
584 data-sidebar="menu-badge"
585 className={cn(
586 "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
587 "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
588 "peer-data-[size=sm]/menu-button:top-1",
589 "peer-data-[size=default]/menu-button:top-1.5",
590 "peer-data-[size=lg]/menu-button:top-2.5",
591 "group-data-[collapsible=icon]:hidden",
592 className,
593 )}
594 {...props}
595 />
596 );
597}
598
599function SidebarMenuSkeleton({
600 className,
601 showIcon = false,
602 ...props
603}: ComponentProps<"div"> & {
604 showIcon?: boolean;
605}) {
606 // Random width between 50 to 90%.
607 const width = useMemo(() => {
608 return `${Math.floor(Math.random() * 40) + 50}%`;
609 }, []);
610
611 return (
612 <div
613 data-slot="sidebar-menu-skeleton"
614 data-sidebar="menu-skeleton"
615 className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
616 {...props}
617 >
618 {showIcon && (
619 <Skeleton
620 className="size-4 rounded-md"
621 data-sidebar="menu-skeleton-icon"
622 />
623 )}
624 <Skeleton
625 className="h-4 max-w-(--skeleton-width) flex-1"
626 data-sidebar="menu-skeleton-text"
627 style={
628 {
629 "--skeleton-width": width,
630 } as CSSProperties
631 }
632 />
633 </div>
634 );
635}
636
637function SidebarMenuSub({ className, ...props }: ComponentProps<"ul">) {
638 return (
639 <ul
640 data-slot="sidebar-menu-sub"
641 data-sidebar="menu-sub"
642 className={cn(
643 "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
644 "group-data-[collapsible=icon]:hidden",
645 className,
646 )}
647 {...props}
648 />
649 );
650}
651
652function SidebarMenuSubItem({ className, ...props }: ComponentProps<"li">) {
653 return (
654 <li
655 data-slot="sidebar-menu-sub-item"
656 data-sidebar="menu-sub-item"
657 className={cn("group/menu-sub-item relative", className)}
658 {...props}
659 />
660 );
661}
662
663function SidebarMenuSubButton({
664 asChild = false,
665 size = "md",
666 isActive = false,
667 className,
668 ...props
669}: ComponentProps<"a"> & {
670 asChild?: boolean;
671 size?: "sm" | "md";
672 isActive?: boolean;
673}) {
674 const Comp = asChild ? Slot : "a";
675
676 return (
677 <Comp
678 data-slot="sidebar-menu-sub-button"
679 data-sidebar="menu-sub-button"
680 data-size={size}
681 data-active={isActive}
682 className={cn(
683 "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
684 "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
685 size === "sm" && "text-xs",
686 size === "md" && "text-sm",
687 "group-data-[collapsible=icon]:hidden",
688 className,
689 )}
690 {...props}
691 />
692 );
693}
694
695export {
696 Sidebar,
697 SidebarContent,
698 SidebarFooter,
699 SidebarGroup,
700 SidebarGroupAction,
701 SidebarGroupContent,
702 SidebarGroupLabel,
703 SidebarHeader,
704 SidebarInput,
705 SidebarInset,
706 SidebarMenu,
707 SidebarMenuAction,
708 SidebarMenuBadge,
709 SidebarMenuButton,
710 SidebarMenuItem,
711 SidebarMenuSkeleton,
712 SidebarMenuSub,
713 SidebarMenuSubButton,
714 SidebarMenuSubItem,
715 SidebarProvider,
716 SidebarRail,
717 SidebarSeparator,
718 SidebarTrigger,
719 useSidebar,
720};