4.2.0
CoreSidebar

Sidebar API

Every prop of the 23 parts Sidebar exports, plus each of the 2 symbols it exports alongside them, generated from the package manifest.

import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from '@oceanic-hub/brand-system'
Layer
core — shadcn-derived primitives.
Exports
Sidebar · SidebarContent · SidebarFooter · SidebarGroup · SidebarGroupAction · SidebarGroupContent · SidebarGroupLabel · SidebarHeader · SidebarInput · SidebarInset · SidebarMenu · SidebarMenuAction · SidebarMenuBadge · SidebarMenuButton · SidebarMenuItem · SidebarMenuSkeleton · SidebarMenuSub · SidebarMenuSubButton · SidebarMenuSubItem · SidebarProvider · SidebarRail · SidebarSeparator · SidebarTrigger · useSidebaralso: sidebarMenuButtonVariantstypes: SidebarContextProps · SidebarMenuButtonProps · SidebarProps · SidebarProviderProps
Variants
  • side: left | right
  • variant: floating | inset | sidebar
  • collapsible: icon | none | offcanvas
  • variant: default | outline
  • size: default | sm | lg
  • size: md | sm
  • variant: default | destructive | ghost | link | outline | secondary
  • size: icon | icon-lg | icon-sm | lg | md | sm
Contract
packages/brand-system/src/components/sidebar.contract.test-d.ts
Demos
8 on the Sidebar page — rendered live, hydrated
Source
packages/brand-system/src/components/sidebar.tsx

Generated from manifest/component-manifest.json, so it cannot drift from the source. For what Sidebar is for, how it composes and what it looks like, see Sidebar.

SidebarProps

Prop

Type

Also accepts everything from React.ComponentProps<'div'>.

SidebarContent

A styled <div> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarFooter

A styled <div> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarGroup

A styled <div> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarGroupAction

React.ComponentProps<'button'> & { asChild?: boolean }

Prop

Type

Also accepts everything from React.ComponentProps<'button'>.

SidebarGroupContent

A styled <div> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarGroupLabel

React.ComponentProps<'div'> & { asChild?: boolean }

Prop

Type

Also accepts everything from React.ComponentProps<'div'>.

SidebarHeader

A styled <div> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarInput

React.ComponentProps<typeof Input>

Prop

Type

Also accepts everything from React.ComponentProps<typeof Input>.

SidebarInset

A styled <main> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarMenu

A styled <ul> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarMenuAction

React.ComponentProps<'button'> & { asChild?: boolean; showOnHover?: boolean }

Prop

Type

Also accepts everything from React.ComponentProps<'button'>.

SidebarMenuBadge

A styled <div> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarMenuButton

SidebarMenuButtonProps

Prop

Type

Also accepts everything from React.ComponentProps<'button'>, VariantProps<typeof sidebarMenuButtonVariants>.

SidebarMenuItem

A styled <li> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarMenuSkeleton

React.ComponentProps<'div'> & { showIcon?: boolean }

Prop

Type

Also accepts everything from React.ComponentProps<'div'>.

SidebarMenuSub

A styled <ul> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarMenuSubButton

React.ComponentProps<'a'> & { asChild?: boolean; size?: 'sm' | 'md'; isActive?: boolean }

Prop

Type

Also accepts everything from React.ComponentProps<'a'>.

SidebarMenuSubItem

A styled <li> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarProvider

SidebarProviderProps

Prop

Type

Also accepts everything from React.ComponentProps<'div'>.

SidebarRail

A styled <button> with no API of its own. It takes that element's standard attributes — className, event handlers, ref — and nothing else.

SidebarSeparator

Inherited from the primitive underneath — this package adds none of its own. DOM attributes are accepted too and omitted here.

Prop

Type

SidebarTrigger

React.ComponentProps<typeof Button>

Prop

Type

Also accepts everything from React.ComponentProps<typeof Button>.

useSidebar

A React hook.Call it inside a component rendered under this module's provider; outside one it throws, which is the contract rather than a bug.

(): SidebarContextProps

sidebarMenuButtonVariants

A cva class builder. It returns the class string for a set of variants, so a foreign element can wear this component's surface — a link styled as a button, an AlertDialogAction styled as a destructive one. An advanced move: reach for the component first.

(props?: ({ variant?: "default" | "outline" | null | undefined; size?: "default" | "sm" | "lg" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined): string

Parameters

Prop

Type

Variant axes

Read off the component's own cva config, so this table and the parts that consume it cannot disagree.

Prop

Type

On this page