React

Side Panel

A panel component that slides in from the left or right edge of the screen. Used to provide additional content or navigation in desktop environments.

Available since@seed-design/react@2.0.0, @seed-design/css@2.0.0

Installation

Default

Includes the basic Side Panel component that slides from the left/right edge.

npx @seed-design/cli@latest add ui:side-panel

Responsive

A responsive variant that automatically switches to Bottom Sheet based on viewport. Dependencies include both ui:bottom-sheet and ui:side-panel.

npx @seed-design/cli@latest add ui:responsive-side-panel

Props

SidePanelRoot

Prop

Type

children?React.ReactNode
open?boolean | undefined
onOpenChange?((open: boolean, details?: DrawerChangeDetails) => void) | undefined

SidePanelTrigger

Prop

Type

SidePanelContent

Prop

Type

title?React.ReactNode
description?React.ReactNode
layerIndex?number | undefined
width?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
maxWidth?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined

SidePanelBody

Prop

Type

height?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
minHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
maxHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
paddingX?ResponsiveValue<0 | (string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText"> | undefined
justifyContent?"flex-start" | "flex-end" | "center" | "space-between" | "space-around" | undefined
alignItems?"flex-start" | "flex-end" | "center" | "stretch" | undefined

SidePanelFooter

Prop

Type

ResponsiveSidePanelRoot

Prop

Type

children?React.ReactNode
open?boolean | undefined
defaultOpen?boolean | undefined
onOpenChange?((open: boolean) => void) | undefined

Examples

Trigger

<SidePanelTrigger> uses the asChild pattern to allow child elements to open the Side Panel.

Controlled

You can open and close the Side Panel in ways other than the Trigger. In this case, use the open prop to control the Side Panel's state.

Direction

You can change the direction the Side Panel opens by setting the direction prop on <SidePanelRoot>. Supports "left" or "right", with the default being "right".

Size

You can change the Side Panel's width by setting the size prop on <SidePanelRoot>. Supports "small" (480px), "medium" (720px, default), and "large" (960px).

SidePanelFooter provides only flex layout, and button arrangement is directly composed with VStack, HStack, etc. In narrow panels, you can stack vertically with VStack, and in wide panels, align horizontally with HStack.

Custom Size

You can directly control the width by passing width and maxWidth props to <SidePanelContent>. Use this when you need flexible viewport-based width instead of preset sizes.

Show Close Button

You can show the close button by passing the showCloseButton prop to <SidePanelContent>. The default value is true.

Dismissible

Setting the dismissible prop to false prevents closing with the Escape key or outside clicks. Use this when you intentionally want to prevent the Side Panel from being closed.

Non-modal

Setting the modal prop to false allows interaction with the background. The Backdrop is not displayed, and the focus trap is disabled. If you need to close it by pressing the Trigger again, control the state directly with the open prop.

Responsive

Using ResponsiveSidePanel automatically switches to Side Panel for md and above and to Bottom Sheet for sm and below. Try reducing the viewport to see the switch in action. onOpenChange passes only the open state, and Root options that apply only to Side Panel or Bottom Sheet are passed via sidePanelRootProps and bottomSheetRootProps.

Keyboard Interactions

KeyBehavior
EscapeCloses the Side Panel when dismissible=true.
TabCycles focus between elements inside the Side Panel when modal=true.
Shift + TabCycles focus in reverse when modal=true.

Table of contents