# Drawer

A modal edge panel with a steady header, scrollable body and optional footer.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, Drawer, Button, Field, Input } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Drawer title="Project settings" description="Keep the details close." trigger={props => <Button {...props}>Open settings</Button>}>
        <Field label="Project name">{control => <Input {...control} defaultValue="Flood" />}</Field>
      </Drawer>
    </FloodRoot>
  );
}
```

## Design notes

- Uses Flood native Dialog focus containment, scroll lock, background inertness, nested layers and return focus. Escape and the named close IconButton dismiss it; closeOnOutsideClick defaults to true. Controlled open/onOpenChange and initialFocusRef match Dialog.
- side is logical start/end or physical top/bottom. size sets 20/26/34rem for sm/md/lg, capped to the viewport. Vertical drawers occupy the viewport height; horizontal drawers occupy its width. Entry motion respects reduced motion; closing is immediate.
- The body scrolls with Flood ScrollArea while the header and optional footer remain visible when space allows. Responsive padding and full-width narrow descriptions preserve the reading area at enlarged text; if the chrome cannot fit, the whole panel can scroll rather than clipping the body. Footer actions are host-owned, without implicit save or close. No swipe/drag gesture or nested navigation engine is included. Available in 0.2.5.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `title` | `string` | `Required` |
| `description` | `string` | `—` |
| `trigger` | `(props: OverlayTriggerProps) => ReactNode` | `Required` |
| `children` | `ReactNode` | `—` |
| `open` | `boolean` | `—` |
| `defaultOpen` | `boolean` | `false` |
| `onOpenChange` | `(open: boolean) => void` | `—` |
| `disabled` | `boolean` | `—` |
| `closeLabel` | `string` | `"Close"` |
| `closeOnOutsideClick` | `boolean` | `true` |
| `initialFocusRef` | `RefObject<HTMLElement \| null>` | `—` |
| `side` | `"start" \| "end" \| "top" \| "bottom"` | `"end"` |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
| `footer` | `ReactNode` | `—` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDialogElement>, "children" \| "title" \| "role">` | `Forwarded` |
