Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Sidebar

Grouped navigation that can collapse without losing its controls.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Icon navigation keeps accessible item names when collapsed; expand to reveal labels.

Open preview

Icon navigation keeps accessible item names when collapsed; expand to reveal labels.

Open preview

Collapse the navigation to give the content more room. On narrow screens, the navigation stacks above the content.

Open preview

Usage

Compose header, content, groups, items and footer. Enable collapsible to expose the built-in toggle; use collapsed/onCollapsedChange to own its state.

collapseOnMobile supplies a responsive default at 720px and below until an uncontrolled sidebar is explicitly toggled. Provide icons for an informative collapsed rail, and decide how navigation should behave in the surrounding layout.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluSidebarProps

Type source
PimoluSidebarProps public API
NameTypeDefaultDescription
stickyboolean | undefinedfalseStick to the top of the scroll container.
collapsibleboolean | undefinedfalseShow a built-in control to collapse and expand the navigation.
collapsedboolean | undefined—Controlled collapsed state.
defaultCollapsedboolean | undefined—Initial collapsed state when uncontrolled.
collapseOnMobileboolean | undefinedtrueStart collapsed below 720px unless the state is controlled or explicitly set.
onCollapsedChange((collapsed: boolean) => void) | undefined—Public Pimolu prop; see the source declaration for details.
collapseLabelstring | undefined"Collapse sidebar"Public Pimolu prop; see the source declaration for details.
expandLabelstring | undefined"Expand sidebar"Public Pimolu prop; see the source declaration for details.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
sticky

boolean | undefined

Default: false

Stick to the top of the scroll container.

collapsible

boolean | undefined

Default: false

Show a built-in control to collapse and expand the navigation.

collapsed

boolean | undefined

No default extracted.

Controlled collapsed state.

defaultCollapsed

boolean | undefined

No default extracted.

Initial collapsed state when uncontrolled.

collapseOnMobile

boolean | undefined

Default: true

Start collapsed below 720px unless the state is controlled or explicitly set.

onCollapsedChange

((collapsed: boolean) => void) | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

collapseLabel

string | undefined

Default: "Collapse sidebar"

Public Pimolu prop; see the source declaration for details.

expandLabel

string | undefined

Default: "Expand sidebar"

Public Pimolu prop; see the source declaration for details.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluSidebarHeaderProps

Type source
PimoluSidebarHeaderProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluSidebarContentProps

Type source
PimoluSidebarContentProps public API
NameTypeDefaultDescription
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluSidebarGroupProps

Type source
PimoluSidebarGroupProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluSidebarGroupLabelProps

Type source
PimoluSidebarGroupLabelProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLSpanElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLSpanElement> | undefined—Standard React/HTML attribute.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLSpanElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLSpanElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluSidebarItemProps

Type source
PimoluSidebarItemProps public API
NameTypeDefaultDescription
activeboolean | undefinedfalsePublic Pimolu prop; see the source declaration for details.
disabledboolean | undefinedfalsePublic Pimolu prop; see the source declaration for details.
iconReactNode—Decorative icon shown before the label.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
typestring | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLAnchorElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLAnchorElement> | undefined—Standard React/HTML attribute.
active

boolean | undefined

Default: false

Public Pimolu prop; see the source declaration for details.

disabled

boolean | undefined

Default: false

Public Pimolu prop; see the source declaration for details.

icon

ReactNode

No default extracted.

Decorative icon shown before the label.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

type

string | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLAnchorElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLAnchorElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluSidebarFooterProps

Type source
PimoluSidebarFooterProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Name SidebarContent and keep visible labels for expanded navigation.
  • Test collapse/expand with the keyboard. Icons supplement link names; they do not replace accessible text.
Read the accessibility guide →