---
title: Layouts
description: Put the agent beside your product, over it, inside a page, or as a page of its own.
---

Each layout wraps a [thread](/docs/components#thread) and takes all of its props, so `chat`, `title`, `empty`, `tools` and `labels` work the same everywhere.

| Layout | Item | Use it for |
| --- | --- | --- |
| `LoomPanel` | `panel` | A panel docked to the side, beside the page |
| `LoomWidget` | `widget` | A floating window from a corner launcher |
| `LoomInline` | `inline` | A card inside a page |
| `LoomPage` | `page` | The agent as the whole page |

## Panel

Docked to the end of the page (the right, in left-to-right languages). The page stays usable while it's open, and on phones it can be swiped away.

```bash
npx shadcn@latest add https://loom.mkhonta.com/r/panel.json
```

```tsx
"use client";

import { LoomPanel, LoomPanelTrigger, createLoomPanelController } from "@/components/loom/panel";
import { useLoomEve } from "@/lib/loom/eve";
import { useState } from "react";

export function Assistant() {
  const chat = useLoomEve({ agent: "support" });
  const [panel] = useState(createLoomPanelController);
  return (
    <>
      <LoomPanelTrigger controller={panel}>Ask support</LoomPanelTrigger>
      <LoomPanel chat={chat} controller={panel} shortcut="mod+k" />
    </>
  );
}
```

| Prop | Type | Default | Description |
| - | - | - | - |
| `side?` | `"start" \| "end"` | `"end"` | The edge it docks to, following the writing direction. |
| `width?` | `number` | `420` | Width in pixels on screens wide enough for it. |
| `launcher?` | `boolean` | `false` | Shows a floating button that opens it. |
| `shortcut?` | `string` | - | Keyboard shortcut that toggles it, like `"mod+k"`: ⌘ on Apple platforms, Ctrl elsewhere. |
| `controller?` | `LoomPanelController` | - | Shares open state with your own triggers. Create one with `createLoomPanelController()`. |
| `open?` | `boolean` | - | Controls whether it's open. |
| `defaultOpen?` | `boolean` | - | |
| `onOpenChange?` | `(open: boolean) => void` | - | |

## Widget

A floating window above the page, opened from a launcher in the corner. It stays open while people use the page behind it, keeps its conversation while closed, and becomes a sheet on small touch screens.

```bash
npx shadcn@latest add https://loom.mkhonta.com/r/widget.json
```

```tsx
<LoomWidget chat={chat} position="bottom-right" shortcut="mod+j" />
```

To open it from your own button as well, share a controller the same way as the panel's: `createLoomWidgetController()` and `LoomWidgetTrigger`. Set `launcher={false}` to open it only from your own buttons.

| Prop | Type | Default | Description |
| - | - | - | - |
| `position?` | `"bottom-right" \| "bottom-left"` | `"bottom-right"` | Corner for the launcher and the window. |
| `launcher?` | `boolean` | `true` | Shows the floating launcher. |
| `icon?` | `ReactNode` | - | The launcher's icon. |
| `shortcut?` | `string` | - | Keyboard shortcut that toggles it. |
| `controller?` | `LoomWidgetController` | - | Shares open state with your own triggers. |
| `open?` | `boolean` | - | |
| `defaultOpen?` | `boolean` | - | |
| `onOpenChange?` | `(open: boolean) => void` | - | |

## Inline

The agent in a card of its own, for a help page, a dashboard tile or a modal. It's 600px tall by default; set the height with `className`.

```tsx
<LoomInline chat={chat} className="h-[480px]" />
```

## Page

The agent as the whole page, with past conversations beside it. It fills its container, so give that the height. The sidebar hides on small screens.

Pass `sessions` and the sidebar is a [session list](/docs/components#session-list) with those props:

```tsx
<div className="h-dvh">
  <LoomPage
    chat={chat}
    sessions={{ sessions, currentId, onSelect: setCurrentId, onNew: () => setCurrentId(undefined) }}
  />
</div>
```

For a sidebar of your own, pass `sidebar` instead:

```tsx
<LoomPage chat={chat} sidebar={<Projects />} />
```
