VDS

Sidepanel

A slide-out panel from the edge of the screen.

Installation

npx @vds-testing/cli add sidepanel
npx @vds-testing/cli add sidepanel

Usage

import {
  Sidepanel,
  SidepanelTrigger,
  SidepanelOverlay,
  SidepanelContent,
  SidepanelHeader,
  SidepanelTitle,
  SidepanelDescription,
  SidepanelFooter,
  SidepanelClose
} from "@/components/vds/sidepanel"
<Sidepanel>
  <SidepanelTrigger>Open</SidepanelTrigger>
  <SidepanelOverlay />
  <SidepanelContent>
    <SidepanelHeader>
      <SidepanelTitle>Sidepanel Title</SidepanelTitle>
      <SidepanelDescription>Sidepanel description goes here.</SidepanelDescription>
    </SidepanelHeader>
    <SidepanelFooter>
      <Button variant="secondary">Cancel</Button>
      <Button>Save</Button>
    </SidepanelFooter>
  </SidepanelContent>
</Sidepanel>

Examples

Side positions

Without close button

Anatomy

  • Sidepanel - Root container that manages state
  • SidepanelTrigger - Button that opens the sidepanel
  • SidepanelOverlay - Background overlay
  • SidepanelContent - The sliding panel (renders the close button at the top)
  • SidepanelHeader - Header container for title and description
  • SidepanelTitle - Title text (uses vds-heading-2)
  • SidepanelDescription - Description text
  • SidepanelFooter - Footer pinned to the bottom, holds the action buttons
  • SidepanelClose - Button that closes the sidepanel

Actions

A sidepanel always uses a single primary CTA plus an optional secondary button — at most two buttons. Place them in SidepanelFooter, which is pinned to the bottom of the panel.

Props

SidepanelContent

Prop Type Default Description
side “right” | “left” “right” Edge of screen to slide from
showCloseButton boolean true Show the X close button at the top
class string - Additional CSS classes