# PaneDropOverlay

> Where a dragged tab will land — the half of a pane a split will take, or the whole pane — shaded with the drop place and its words in a HUD chip.

Source: https://raft-design.botiverse.build/components/pane-drop-overlay. Generated from the current release; where it differs from what you remember, this page is right.

PaneDropOverlay shows where a dragged tab will land, as the area the new pane will take: at a pane's edge, the half a split will take; in its middle, the whole pane. The shade is the one look for a place, [DropPlaceholder](https://raft-design.botiverse.build/components/drag.md), with the zone's words in a HUD chip ([Tabs and panes](https://raft-design.botiverse.build/patterns/tabs-and-panes.md#dragging)).

```tsx
import { PaneDropOverlay } from "@botiverse/raft-ui/wip";

const RECT = { left: 0, top: 0, width: 200, height: 120 };

/**
 * Where a dragged tab will land: an edge of a pane shades the half the new
 * pane will take, the middle shades the whole pane. Over the conversation it
 * says so in its own words.
 */
export function PaneDropOverlayZonesContent() {
  return (
    <div className="grid w-full max-w-3xl grid-cols-[repeat(auto-fill,200px)] gap-3">
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="top" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="bottom" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="left" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="right" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay rect={RECT} zone="center" portal={false} />
      </div>
      <div className="relative h-30 w-50 overflow-hidden rounded-control border border-line-hairline bg-layer-canvas">
        <PaneDropOverlay
          rect={RECT}
          zone="right"
          label="Split right of the conversation"
          portal={false}
        />
      </div>
    </div>
  );
}
```

## When to use

| Situation                                     | Use                                                                                                                         |
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| A tab dragged over a pane or the conversation | PaneDropOverlay                                                                                                             |
| A tab dragged over a tab bar                  | The bar's insertion line ([TabBar](https://raft-design.botiverse.build/components/tab-bar.md) `insertAt`)                                                       |
| An item dragged within or between lists       | [Drag](https://raft-design.botiverse.build/components/drag.md): the dashed place in the list                                                                       |
| A place that won't take the item              | No shade: the refusal hint by the pointer ([Drag and drop](https://raft-design.botiverse.build/patterns/drag-and-drop.md#refused-places)) |

## Anatomy

- The overlay, laid over the zone's area (`paneDropArea`), with a `DropPlaceholder` on the strong fill, because it lies over live content.
- The words, in a HUD chip in its middle.

## Behavior

- `paneDropZone(rect, x, y)` gives the zone a point is in: the nearest edge within 25% of the whole pane's width or height (its tab bar included), else `center`.
- An edge shades that half of the pane: Split up, Split down, Split left, Split right. The middle shades the whole pane: Move to this pane. Over the conversation the app passes its own words in `label`: Split right of the conversation.
- With `portal` (the default) it renders in the nearest portal container, else `document.body`, `fixed` at the drag's layer, so it lies above pages laid over the panes from a fixed layer; `rect` is in client px. Without it, it is `absolute` in the pane's positioned parent.
- It moves between zones in 120ms with the drag's settle easing.

## Content

- Say what the drop does, in the words of the tab's menu: Split right, Move to this pane. Pass translations as `messages`.

## Accessibility

- It is hidden from assistive technology: the drag's announcements say where the tab is ([Drag and drop](https://raft-design.botiverse.build/patterns/drag-and-drop.md#screen-readers)).
- Dragging is never the only way: Move to another pane in the tab's menu is the keyboard's path.

## Rules

- Shade the area the new pane will take, never a line or an outline alone.
- Shade nothing over a place that won't take the tab.

## API

### PaneDropOverlay

Where a dragged tab will land, as the area the new pane will take: an edge shades that half of the pane, its tab bar included, and the middle shades the whole pane, each with its words in a HUD chip. The shade is the one look for a place, `DropPlaceholder`, on the strong fill because it lies over live content. Hidden from assistive technology: the drag's announcements say where the tab is.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` |  | Words in place of the zone's own, such as "Split right of the conversation". |
| `messages` | `Partial<PaneDropOverlayMessages>` |  |  |
| `portal` | `boolean` | `true` | Render in a portal (the nearest `PortalContainerProvider`'s container, else `document.body`), `fixed` above live pages laid over the panes. Off: `absolute` in the pane's own positioned parent. |
| `rect` (required) | `PaneDropRect` |  | The pane's box in client px (`portal`) or in its positioned parent's px: the whole pane, its tab bar included. |
| `zone` (required) | `PaneDropZone` |  |  |

Also takes the attributes of its element.
