import { useState } from "react"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { Drawer } from "@shared/components/Drawer"; import { Button } from "@shared/components/Button"; const meta: Meta = { title: "Primitives/Drawer", component: Drawer, parameters: { layout: "fullscreen" }, tags: ["autodocs"], args: { side: "right", width: "md", title: "Pipeline detail", subtitle: "COI Compliance · us-east-1", }, argTypes: { side: { control: "inline-radio", options: ["left", "right"] }, width: { control: "inline-radio", options: ["sm", "md", "lg"] }, }, decorators: [ (S) => (
), ], render: (args) => { function Bound() { const [open, setOpen] = useState(true); return ( <> setOpen(false)}>

The drawer body scrolls when its content overflows. The header and footer (when present) are sticky.

); } return ; }, }; export default meta; type Story = StoryObj; /** Flip side / width / title / subtitle in controls. */ export const Playground: Story = {}; export const WithFooter: Story = { render: () => { function Bound() { const [open, setOpen] = useState(true); return ( <> setOpen(false)} side="right" width="md" title="Pipeline detail" subtitle="COI Compliance · us-east-1" footer={ <> } >

Sticky footer demo — scroll the body, footer stays anchored.

); } return ; }, };