Components
Sidebar
A panel of navigation beside the page, that folds into a rail of icons and becomes a drawer on small screens.
Introduction
A sidebar is the main navigation of an app: many links, grouped, always in view next to the page. It suits dashboards and documentation, where a top bar would run out of room.
- Folds into a narrow rail of icons, or slides out of sight, to give the page more room. The labels stay for screen readers and show as tooltips.
- On small screens it becomes a drawer that slides over the page. Focus stays inside it, and Escape or a tap outside closes it.
- Groups with headings, items with icons and badges, and submenus that open in place. The current page is marked with
aria-current. - Control it from anywhere: the trigger can be in the page's top bar, and an optional shortcut folds it with Ctrl+B or Cmd+B.
For the bar at the top of a page, see Navbar. The two work well together: the navbar on top, the sidebar below it.
Installation
centerUI has no CLI or registry yet: components are copied into your project. Sidebar uses Button for the trigger, so it needs everything Button needs.
# bun
bun add react-aria-components tailwind-variants tailwind-merge clsx
# pnpm
pnpm add react-aria-components tailwind-variants tailwind-merge clsx
# npm
npm install react-aria-components tailwind-variants tailwind-merge clsxAdd Button first (see its Manual installation), then follow the steps below.
Manual installation
Copy these files into your project and keep the paths, or adjust the imports.
1. Add the styles
src/types/sidebar-styles.tsShow code
import { tv } from "tailwind-variants";
// Styles for Sidebar. Everything inside the sidebar reads whether it is drawn
// as a narrow rail from a `data-rail` attribute on the sidebar, through the
// `group/sidebar` name.
export const sidebarStyles = tv({
slots: {
provider: "flex h-full min-h-0 w-full min-w-0",
root: [
"group/sidebar relative flex h-full shrink-0 flex-col overflow-hidden bg-card text-card-fg",
"transition-[width] duration-200 ease-out motion-reduce:transition-none",
],
inner: "flex h-full min-h-0 w-full min-w-0 flex-col",
drawerOverlay:
"fixed inset-0 z-50 bg-black/40 data-entering:animate-fade-in data-exiting:animate-fade-out motion-reduce:animate-none",
drawer:
"fixed inset-y-0 z-50 flex w-72 max-w-[85vw] flex-col bg-card text-card-fg shadow-xl outline-none motion-reduce:animate-none",
header: "flex shrink-0 flex-col gap-2 p-2",
content:
"no-scrollbar flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto p-2",
footer: "flex shrink-0 flex-col gap-2 border-t p-2",
group: "flex flex-col gap-1",
groupLabel: [
"flex h-7 shrink-0 items-center px-2 text-xs font-medium tracking-wide text-muted-fg uppercase",
"group-data-rail/sidebar:sr-only",
],
menu: "flex flex-col gap-0.5",
item: [
"flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-md px-2.5 text-left text-sm text-muted-fg outline-none transition-colors",
"hover:bg-muted hover:text-fg",
"focus-visible:ring-2 focus-visible:ring-ring",
"data-active:bg-muted data-active:font-medium data-active:text-fg",
"group-data-rail/sidebar:justify-center group-data-rail/sidebar:px-0",
"[&_svg]:size-4 [&_svg]:shrink-0",
],
itemLabel: "min-w-0 flex-1 truncate group-data-rail/sidebar:sr-only",
itemBadge:
"ml-auto shrink-0 rounded-full bg-secondary px-1.5 text-xs font-medium text-secondary-fg group-data-rail/sidebar:hidden",
chevron:
"ml-auto size-3.5 shrink-0 transition-transform group-aria-expanded/submenu:rotate-90 group-data-rail/sidebar:hidden",
subPanel: "ml-4 border-l pl-2 pt-0.5 group-data-rail/sidebar:hidden",
separator: "mx-2 my-1 h-px shrink-0 bg-border",
inset: "flex min-h-0 min-w-0 flex-1 flex-col",
},
variants: {
// How wide the sidebar is right now. On its own row of variants so the
// width can animate between them.
width: {
full: { root: "w-64" },
rail: { root: "w-14" },
hidden: { root: "w-0 border-0" },
},
side: {
left: {
root: "border-r",
drawer:
"left-0 border-r data-entering:animate-drawer-in-left data-exiting:animate-drawer-out-left",
},
right: {
root: "border-l",
drawer:
"right-0 border-l data-entering:animate-drawer-in-right data-exiting:animate-drawer-out-right",
},
},
},
defaultVariants: { width: "full", side: "left" },
});2. Add the context
It shares the state between the provider, the sidebar and its items.
src/types/sidebar-context.tsShow code
import { createContext, useContext } from "react";
/**
* Below which width the sidebar becomes a drawer: below `md` or `lg`,
* `"always"`, or `"never"`.
*/
export type SidebarDrawer = "md" | "lg" | "always" | "never";
/** What a SidebarProvider shares with the sidebar and everything in it. */
export interface SidebarContextValue {
/** Whether the sidebar is folded (a rail of icons, or hidden). */
isCollapsed: boolean;
setCollapsed: (isCollapsed: boolean) => void;
/** Whether the screen is small enough that the sidebar is a drawer. */
isMobile: boolean;
isDrawerOpen: boolean;
setDrawerOpen: (isOpen: boolean) => void;
/** Whether the sidebar is drawn as a narrow rail with only icons. */
isRail: boolean;
side: "left" | "right";
}
const SidebarContext = createContext<SidebarContextValue | null>(null);
export const SidebarContextProvider = SidebarContext.Provider;
/** The enclosing SidebarProvider's state. Throws outside of one. */
export function useSidebar() {
const context = useContext(SidebarContext);
if (!context) {
throw new Error("Sidebar parts must be used inside a SidebarProvider.");
}
return context;
}3. Add the media query hook
It tells the provider whether the screen is small enough for the drawer.
src/types/use-media-query.tsShow code
import { useSyncExternalStore } from "react";
/**
* Whether a CSS media query matches, kept up to date as the window changes.
* On the server, and while the page hydrates, it is `serverValue`, so the
* markup matches what the server sent.
*/
export function useMediaQuery(query: string, serverValue = false) {
return useSyncExternalStore(
(onChange) => {
const list = window.matchMedia(query);
list.addEventListener("change", onChange);
return () => list.removeEventListener("change", onChange);
},
() => window.matchMedia(query).matches,
() => serverValue,
);
}4. Add the Sidebar file
src/components/ui/sidebar/sidebar.tsxShow code
"use client";
import Link from "next/link";
import {
type ComponentProps,
type ComponentPropsWithoutRef,
createContext,
type ReactNode,
useContext,
useEffect,
useId,
useMemo,
useState,
} from "react";
import {
Button as AriaButton,
Dialog,
Disclosure,
DisclosurePanel,
Heading,
Modal,
ModalOverlay,
} from "react-aria-components";
import { ChevronRightIcon, PanelLeftIcon } from "@/components/icons";
import { Button } from "@/components/ui/button/button";
import { cn } from "@/lib/cn";
import {
SidebarContextProvider,
type SidebarDrawer,
useSidebar,
} from "@/types/sidebar-context";
import { sidebarStyles } from "@/types/sidebar-styles";
import { useMediaQuery } from "@/types/use-media-query";
export interface SidebarProviderProps {
/** Whether the sidebar is folded, for a controlled sidebar. */
isCollapsed?: boolean;
/** Whether the sidebar starts folded, for an uncontrolled one. */
defaultCollapsed?: boolean;
onCollapsedChange?: (isCollapsed: boolean) => void;
/**
* Below which width the sidebar becomes a drawer that slides over the page:
* below `md` (default) or `lg`. `"always"` keeps it a drawer, `"never"` keeps
* it beside the page.
*/
drawer?: SidebarDrawer;
/** Fold and unfold the sidebar with Ctrl+B or Cmd+B. Use it on one sidebar per page. */
hasShortcut?: boolean;
className?: string;
children?: ReactNode;
}
/**
* Holds the state of a sidebar (folded or not, and whether the drawer is open)
* and lays the sidebar out beside the page. Put a `Sidebar` and a
* `SidebarInset` inside it, and a `SidebarTrigger` wherever you want the
* button. Give it a height (`h-screen`, or the height of its parent): the
* sidebar fills it.
*
* On small screens the sidebar is a drawer, opened by the trigger.
*
* @example
* <SidebarProvider className="h-screen">
* <Sidebar>…</Sidebar>
* <SidebarInset>
* <SidebarTrigger />
* …the page
* </SidebarInset>
* </SidebarProvider>
*/
export function SidebarProvider({
isCollapsed,
defaultCollapsed = false,
onCollapsedChange,
drawer = "md",
hasShortcut = false,
className,
children,
}: SidebarProviderProps) {
const isControlled = isCollapsed !== undefined;
const [inner, setInner] = useState(defaultCollapsed);
const collapsed = isControlled ? isCollapsed : inner;
const [isDrawerOpen, setDrawerOpen] = useState(false);
const isSmall = useMediaQuery(
drawer === "lg" ? "(max-width: 1023.98px)" : "(max-width: 767.98px)",
);
const isMobile =
drawer === "always" ? true : drawer === "never" ? false : isSmall;
function setCollapsed(next: boolean) {
if (!isControlled) setInner(next);
onCollapsedChange?.(next);
}
// Growing the window past the breakpoint leaves the drawer behind.
useEffect(() => {
if (!isMobile) setDrawerOpen(false);
}, [isMobile]);
useEffect(() => {
if (!hasShortcut) return;
const onKeyDown = (event: KeyboardEvent) => {
if (
event.key.toLowerCase() !== "b" ||
!(event.metaKey || event.ctrlKey)
) {
return;
}
event.preventDefault();
if (isMobile) setDrawerOpen((open) => !open);
else {
if (!isControlled) setInner(!collapsed);
onCollapsedChange?.(!collapsed);
}
};
window.addEventListener("keydown", onKeyDown);
return () => window.removeEventListener("keydown", onKeyDown);
}, [hasShortcut, isMobile, collapsed, isControlled, onCollapsedChange]);
const value = {
isCollapsed: collapsed,
setCollapsed,
isMobile,
isDrawerOpen,
setDrawerOpen,
isRail: false,
side: "left" as const,
};
return (
<SidebarContextProvider value={value}>
<div className={cn(sidebarStyles().provider(), className)}>
{children}
</div>
</SidebarContextProvider>
);
}
export interface SidebarProps {
/** Which edge of the page the sidebar sits on. */
side?: "left" | "right";
/**
* What folding does: shrink to a narrow rail of icons (`"icon"`, default),
* slide out of sight (`"hidden"`), or nothing (`"none"`, the sidebar is only
* a drawer on small screens).
*/
collapsible?: "icon" | "hidden" | "none";
/** Names the navigation for screen readers. Defaults to "Sidebar". */
"aria-label"?: string;
className?: string;
children?: ReactNode;
}
/**
* The panel of navigation beside the page. Fill it with `SidebarHeader`,
* `SidebarContent` (which scrolls) and `SidebarFooter`. On small screens it is
* a drawer: focus stays inside it, and Escape or a tap outside closes it.
*/
export function Sidebar({
side = "left",
collapsible = "icon",
"aria-label": ariaLabel = "Sidebar",
className,
children,
}: SidebarProps) {
const context = useSidebar();
const isFolded = context.isCollapsed && !context.isMobile;
const isRail = isFolded && collapsible === "icon";
const isHidden = isFolded && collapsible === "hidden";
const styles = sidebarStyles({
side,
width: isHidden ? "hidden" : isRail ? "rail" : "full",
});
const value = useMemo(
() => ({ ...context, isRail, side }),
[context, isRail, side],
);
if (context.isMobile) {
return (
<SidebarContextProvider value={value}>
<ModalOverlay
isOpen={context.isDrawerOpen}
onOpenChange={context.setDrawerOpen}
isDismissable
className={styles.drawerOverlay()}
>
<Modal className={cn(styles.drawer(), className)}>
<Dialog
aria-label={ariaLabel}
className="flex h-full flex-col outline-none"
>
{children}
</Dialog>
</Modal>
</ModalOverlay>
</SidebarContextProvider>
);
}
return (
<SidebarContextProvider value={value}>
<aside
aria-label={ariaLabel}
data-rail={isRail || undefined}
// Folded out of sight: nothing inside can be tabbed to or read.
inert={isHidden}
className={cn(styles.root(), className)}
>
<div className={cn(styles.inner(), isHidden && "w-64")}>{children}</div>
</aside>
</SidebarContextProvider>
);
}
/** The button that folds and unfolds the sidebar, or opens it as a drawer. */
export function SidebarTrigger({ className }: { className?: string }) {
const { isMobile, isCollapsed, isDrawerOpen, setCollapsed, setDrawerOpen } =
useSidebar();
return (
<Button
isIcon
variant="ghost"
size="sm"
aria-label={
isMobile
? "Open sidebar"
: isCollapsed
? "Expand sidebar"
: "Collapse sidebar"
}
aria-expanded={isMobile ? isDrawerOpen : !isCollapsed}
className={className}
onPress={() =>
isMobile ? setDrawerOpen(true) : setCollapsed(!isCollapsed)
}
>
<PanelLeftIcon />
</Button>
);
}
interface PartProps {
className?: string;
children?: ReactNode;
}
/** The top of the sidebar: a logo, a switcher. It does not scroll. */
export function SidebarHeader({ className, children }: PartProps) {
return (
<div className={cn(sidebarStyles().header(), className)}>{children}</div>
);
}
/** The middle of the sidebar, where the groups go. It scrolls when it is too tall. */
export function SidebarContent({ className, children }: PartProps) {
return (
<div className={cn(sidebarStyles().content(), className)}>{children}</div>
);
}
/** The bottom of the sidebar: the account, settings. It does not scroll. */
export function SidebarFooter({ className, children }: PartProps) {
return (
<div className={cn(sidebarStyles().footer(), className)}>{children}</div>
);
}
/** A thin line between two parts of the sidebar. */
export function SidebarSeparator({ className }: { className?: string }) {
return (
<hr className={cn(sidebarStyles().separator(), "border-0", className)} />
);
}
export interface SidebarGroupProps extends PartProps {
/** A small heading over the group. Shown to screen readers when the sidebar is a rail. */
label?: ReactNode;
}
/** A titled group of menus. */
export function SidebarGroup({
label,
className,
children,
}: SidebarGroupProps) {
const styles = sidebarStyles();
const labelId = useId();
return (
// biome-ignore lint/a11y/useSemanticElements: a plain div with role="group" is what a labelled group of links needs here
<div
role="group"
aria-labelledby={label ? labelId : undefined}
className={cn(styles.group(), className)}
>
{label ? (
<p id={labelId} className={styles.groupLabel()}>
{label}
</p>
) : null}
{children}
</div>
);
}
// Tells items and submenus whether they sit in a list, so they render a list
// item there and a plain element elsewhere (in the footer, for example).
const MenuContext = createContext(false);
/** A list of items and submenus. */
export function SidebarMenu({ className, children }: PartProps) {
return (
<MenuContext.Provider value={true}>
<ul className={cn(sidebarStyles().menu(), className)}>{children}</ul>
</MenuContext.Provider>
);
}
function Wrapper({ children }: { children: ReactNode }) {
const inMenu = useContext(MenuContext);
return inMenu ? <li>{children}</li> : <div>{children}</div>;
}
interface SidebarItemShared {
/** An icon before the label. It stays when the sidebar is a rail. */
icon?: ReactNode;
/** A short value at the end, such as a count. Hidden in a rail. */
badge?: ReactNode;
/** The page the user is on. Highlights the item and marks it as the current page. */
isActive?: boolean;
className?: string;
children?: ReactNode;
}
/** Rendered as a link (`next/link`). */
export interface SidebarItemLinkProps
extends SidebarItemShared,
Omit<ComponentProps<typeof Link>, "className" | "children"> {}
/** Rendered as a `<button>`, for an action instead of a page. */
export interface SidebarItemButtonProps
extends SidebarItemShared,
Omit<ComponentPropsWithoutRef<"button">, "className" | "children"> {
href?: undefined;
}
export type SidebarItemProps = SidebarItemLinkProps | SidebarItemButtonProps;
/**
* An entry of a menu. Pass `href` for a page, or leave it out for a button that
* runs `onClick`. In a rail only the icon is shown, and the label stays for
* screen readers and as a tooltip. Choosing an item closes the drawer.
*/
export function SidebarItem({
icon,
badge,
isActive = false,
className,
children,
onClick,
...props
}: SidebarItemProps) {
const { isRail, isMobile, setDrawerOpen } = useSidebar();
const styles = sidebarStyles();
const classes = cn(styles.item(), className);
const state = {
"data-active": isActive || undefined,
"aria-current": isActive ? ("page" as const) : undefined,
title: isRail && typeof children === "string" ? children : undefined,
};
const content = (
<>
{icon}
<span className={styles.itemLabel()}>{children}</span>
{badge !== undefined && badge !== null ? (
<span className={styles.itemBadge()}>{badge}</span>
) : null}
</>
);
const close = () => {
if (isMobile) setDrawerOpen(false);
};
if (props.href !== undefined) {
return (
<Wrapper>
<Link
{...props}
{...state}
className={classes}
onClick={(event) => {
(onClick as ComponentProps<typeof Link>["onClick"])?.(event);
close();
}}
>
{content}
</Link>
</Wrapper>
);
}
return (
<Wrapper>
<button
type="button"
{...props}
{...state}
className={classes}
onClick={(event) => {
(onClick as ComponentPropsWithoutRef<"button">["onClick"])?.(event);
close();
}}
>
{content}
</button>
</Wrapper>
);
}
export interface SidebarSubmenuProps extends PartProps {
label: ReactNode;
icon?: ReactNode;
/** The section the user is in. Highlights the button like an active item. */
isActive?: boolean;
/** Whether the submenu starts open. */
defaultExpanded?: boolean;
}
/**
* An item that opens a list of more items under it, with a chevron that turns
* as it opens. In a rail, pressing it unfolds the sidebar so the list can be
* seen. Put a `SidebarMenu` inside.
*/
export function SidebarSubmenu({
label,
icon,
isActive = false,
defaultExpanded = false,
className,
children,
}: SidebarSubmenuProps) {
const { isRail, setCollapsed } = useSidebar();
const styles = sidebarStyles();
const [isExpanded, setExpanded] = useState(defaultExpanded);
return (
<Wrapper>
<Disclosure
isExpanded={isExpanded}
onExpandedChange={(next) => {
if (isRail) {
setCollapsed(false);
setExpanded(true);
} else setExpanded(next);
}}
className={className}
>
<Heading className="m-0 text-base font-normal">
<AriaButton
slot="trigger"
data-active={isActive || undefined}
className={cn(styles.item(), "group/submenu")}
>
{icon}
<span className={styles.itemLabel()}>{label}</span>
<ChevronRightIcon className={styles.chevron()} />
</AriaButton>
</Heading>
<DisclosurePanel>
<div className={styles.subPanel()}>{children}</div>
</DisclosurePanel>
</Disclosure>
</Wrapper>
);
}
export interface SidebarInsetProps extends PartProps {
/** The element to render. `main` by default: use `div` when the page has its own. */
as?: "main" | "div" | "section";
}
/** The page next to the sidebar. It takes the rest of the width. */
export function SidebarInset({
as: Component = "main",
className,
children,
}: SidebarInsetProps) {
return (
<Component className={cn(sidebarStyles().inset(), className)}>
{children}
</Component>
);
}It imports ChevronRightIcon and PanelLeftIcon from @/components/icons. Add those icons, or swap them for your own.
5. Add the drawer animations
In src/app/globals.css copy the --animate-drawer-* and --animate-fade-* lines in @theme inline, and the matching drawer-in-*, drawer-out-*, fade-in and fade-out keyframes. Without them the drawer still works, it just appears without sliding.
6. Use it
import {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarGroup,
SidebarHeader,
SidebarInset,
SidebarItem,
SidebarMenu,
SidebarProvider,
SidebarSeparator,
SidebarSubmenu,
SidebarTrigger,
} from "@/components/ui/sidebar/sidebar";Anatomy
A provider that holds the state, a sidebar made of a header, content and footer, and the page beside it.
<SidebarProvider className="h-screen">
<Sidebar>
<SidebarHeader>…logo…</SidebarHeader>
<SidebarContent>
<SidebarGroup label="Platform">
<SidebarMenu>
<SidebarItem href="/" icon={<HomeIcon />} isActive>Home</SidebarItem>
<SidebarSubmenu label="Components" icon={<LayersIcon />}>
<SidebarMenu>
<SidebarItem href="/select">Select</SidebarItem>
</SidebarMenu>
</SidebarSubmenu>
</SidebarMenu>
</SidebarGroup>
</SidebarContent>
<SidebarFooter>…account…</SidebarFooter>
</Sidebar>
<SidebarInset>
<SidebarTrigger />
…the page
</SidebarInset>
</SidebarProvider>| Part | Rendered as | Notes |
|---|---|---|
| SidebarProvider | div | Holds whether the sidebar is folded and whether the drawer is open, and lays the sidebar beside the page. Give it a height. |
| Sidebar | aside (a dialog as a drawer) | The panel. 16rem wide, a 3.5rem rail of icons when folded, or a drawer on small screens. |
| SidebarHeader | div | The top of the panel. Does not scroll. |
| SidebarContent | div | The middle. Scrolls when it is too tall. |
| SidebarFooter | div | The bottom of the panel. Does not scroll. |
| SidebarGroup | div role=group | A titled set of menus. |
| SidebarMenu | ul | A list of items and submenus. |
| SidebarItem | a or button | An entry. Highlighted when it is the current page. Icon only in a rail. |
| SidebarSubmenu | Disclosure | An item that opens a list of more items, with a turning chevron. |
| SidebarSeparator | hr | A thin line between parts. |
| SidebarTrigger | Button | Folds and unfolds the sidebar, or opens the drawer. |
| SidebarInset | main | The page next to the sidebar. Takes the rest of the width. |
The provider fills the height it is given, so set one on it: h-screen for a whole app, or the height of the box it sits in.
Examples
Each example is a small app. Click the button in its top bar to fold the sidebar, and click an item to make it the active one.
Usage
A header, two groups, a submenu, a badge and a footer. Folded, it is a rail of icons, and pressing the Components submenu unfolds it again. Ctrl+B or Cmd+B works here too.
Starts folded
defaultCollapsed starts the sidebar as a rail. The labels are hidden but still read by screen readers, and a tooltip shows them.
Slide out of sight
collapsible=“hidden” folds the sidebar all the way out of view instead of into a rail. Nothing inside it can be tabbed to while it is hidden.
Right side
side=“right” puts the sidebar at the right edge. Place it after the page, and the drawer slides in from the right.
Drawer
Below a width, the sidebar becomes a drawer that slides over the page and opens with the trigger. This preview uses drawer=“always” so you can try it at any width.
| Value | Drawer shown | Use it |
|---|---|---|
| md (default) | below 768px | Drawer on phones, sidebar beside the page from tablets up |
| lg | below 1024px | Drawer on tablets too |
| always | at every width | Always a drawer, opened by the trigger |
| never | at no width | Always beside the page |
Controlled
Keep whether the sidebar is folded in your own state with isCollapsed and onCollapsedChange, for example to remember it between visits.
isCollapsed: false
Keyboard shortcut
hasShortcut folds and unfolds the sidebar with Ctrl+B or Cmd+B (and opens the drawer on small screens). Turn it on for one sidebar per page, since every provider that has it would react. The Usage example above has it on.
{/* Ctrl+B or Cmd+B folds and unfolds it. Use it on one sidebar per page. */}
<SidebarProvider hasShortcut>…</SidebarProvider>Component API
Every part takes a className, and the props below.
SidebarProvider
| Prop | Type | Default |
|---|---|---|
| isCollapsed | boolean | - |
| defaultCollapsed | boolean | false |
| onCollapsedChange | (isCollapsed: boolean) => void | - |
| drawer | "md" | "lg" | "always" | "never" | "md" |
| hasShortcut | boolean | false |
Sidebar
| Prop | Type | Default |
|---|---|---|
| side | "left" | "right" | "left" |
| collapsible | "icon" | "hidden" | "none" | "icon" |
| aria-label | string | "Sidebar" |
collapsible is what folding does: shrink to a rail of icons, slide out of sight, or nothing (the sidebar is then only a drawer on small screens).
SidebarGroup
| Prop | Type | Default |
|---|---|---|
| label | ReactNode | - |
SidebarItem
| Prop | Type | Default |
|---|---|---|
| icon | ReactNode | - |
| badge | ReactNode | - |
| isActive | boolean | false |
| href | string | UrlObject | - (a button without it) |
| onClick | (event) => void | - |
With href it accepts every next/link prop, and without it every button attribute. Inside a SidebarMenu it renders a list item.
SidebarSubmenu
| Prop | Type | Default |
|---|---|---|
| label | ReactNode | - (required) |
| icon | ReactNode | - |
| isActive | boolean | false |
| defaultExpanded | boolean | false |
SidebarInset
| Prop | Type | Default |
|---|---|---|
| as | "main" | "div" | "section" | "main" |
SidebarHeader, SidebarContent, SidebarFooter, SidebarMenu, SidebarSeparator and SidebarTrigger take only a className and their children.