import type { Meta, StoryObj } from '@storybook/nextjs' import { fn } from 'storybook/test' import { useState } from 'react' import Drawer from '.' const meta = { title: 'Base/Feedback/Drawer', component: Drawer, parameters: { layout: 'fullscreen', docs: { description: { component: 'Sliding panel built on Headless UI dialog primitives. Supports optional mask, custom footer, and close behaviour.', }, }, }, tags: ['autodocs'], } satisfies Meta export default meta type Story = StoryObj const DrawerDemo = (props: React.ComponentProps) => { const [open, setOpen] = useState(false) return (
setOpen(false)} title={props.title ?? 'Edit configuration'} description={props.description ?? 'Adjust settings in the side panel and save.'} footer={props.footer ?? undefined} >

This example renders arbitrary content inside the drawer body. Use it for contextual forms, settings, or informational panels.

Content area
) } export const Playground: Story = { render: args => , args: { children: null, isOpen: false, onClose: fn(), }, parameters: { docs: { source: { language: 'tsx', code: ` const [open, setOpen] = useState(false) setOpen(false)} title="Edit configuration" description="Adjust settings in the side panel and save." > ... `.trim(), }, }, }, } export const CustomFooter: Story = { render: args => ( } /> ), args: { children: null, isOpen: false, onClose: fn(), }, parameters: { docs: { source: { language: 'tsx', code: ` }> ... `.trim(), }, }, }, }