Raft Design System

Components · Feedback

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.

ExperimentalAlso called Split zone, Drop zone, Dock overlay
import { PaneDropOverlay } from "@botiverse/raft-ui/wip";

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, with the zone's words in a HUD chip (Tabs and panes).

pane-drop-overlay/compositions/zones

When to use

SituationUse
A tab dragged over a pane or the conversationPaneDropOverlay
A tab dragged over a tab barThe bar's insertion line (TabBar insertAt)
An item dragged within or between listsDrag: the dashed place in the list
A place that won't take the itemNo shade: the refusal hint by the pointer (Drag and drop)

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).
  • 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

ExperimentalWhere 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.
PropTypeDefault
labelWords in place of the zone's own, such as "Split right of the conversation".string
messagesPartial<PaneDropOverlayMessages>
portalRender 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.booleantrue
rect (required)The pane's box in client px (`portal`) or in its positioned parent's px: the whole pane, its tab bar included.PaneDropRect
zone (required)PaneDropZone

Also takes the attributes of its element.