# Sheet

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/sheet
- **Markdown:** https://refast.fastapicloud.dev/docs/components/sheet.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/feedback/sheet.py
- **Live examples:** the widgets on this page need a browser; open the URL above to try them.
- **Applies to:** refast 0.12.2

A panel that slides in from an edge of the screen. Useful for side menus,
detail panels, and quick-edit forms without navigating away.

```python
from refast.components import (
    Sheet, SheetTrigger, SheetContent, SheetHeader,
    SheetTitle, SheetDescription, SheetFooter, SheetClose,
)
```

```python
Sheet(
    children=[
        SheetTrigger(children=[Button("Open")]),
        SheetContent(
            side="right",
            children=[
                SheetHeader(
                    children=[
                        SheetTitle(title="Edit Profile"),
                        SheetDescription(description="Make changes here."),
                    ]
                ),
                # content
                SheetFooter(children=[Button("Save")]),
            ],
        ),
    ]
)
```

## Props

### `Sheet`

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `open` | `bool \| None` | `None` | Controlled open state |
| `default_open` | `bool` | `False` | Initial open state |
| `on_open_change` | `Callback \| None` | `None` | Called when open state changes |
| `width` | `str \| None` | `None` | Custom width (e.g., `"500px"`, `"90vw"`) |
| `height` | `str \| None` | `None` | Custom height (e.g., `"400px"`, `"80vh"`) |
| `max_width` | `str \| None` | `None` | Custom max-width limit |
| `max_height` | `str \| None` | `None` | Custom max-height limit |

### `SheetContent`

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"right"` | Slide-in edge |
| `children` | `ChildrenType` | `None` | Panel content |
| `width` | `str \| None` | `None` | Custom width (e.g., `"500px"`, `"90vw"`) |
| `height` | `str \| None` | `None` | Custom height (e.g., `"400px"`, `"80vh"`) |
| `max_width` | `str \| None` | `None` | Custom max-width limit |
| `max_height` | `str \| None` | `None` | Custom max-height limit |

### `SheetTitle`

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `title` | `str` | *(required)* | Panel heading |

### `SheetDescription`

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `description` | `str` | *(required)* | Supporting text |

## Component Hierarchy

```
Sheet
├── SheetTrigger       ← button that opens the panel
└── SheetContent (side="right")
    ├── SheetHeader
    │   ├── SheetTitle
    │   └── SheetDescription
    ├── (custom form / content)
    └── SheetFooter
        └── SheetClose  ← or any Button with on_click=close
```

## Controlled Sheet

```python
async def open_panel(ctx: Context):
    ctx.state.set("panel_open", True)
    await ctx.refresh()

async def close_panel(ctx: Context):
    ctx.state.set("panel_open", False)
    await ctx.refresh()

# In render:
open_state = ctx.state.get("panel_open", False)

Sheet(
    open=open_state,
    on_open_change=ctx.callback(close_panel),
    children=[
        SheetContent(
            side="left",
            children=[
                SheetHeader(children=[SheetTitle(title="Filters")]),
                # filter controls
                SheetFooter(children=[Button("Apply", on_click=ctx.callback(close_panel))]),
            ]
        )
    ]
)
```

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
