Raft Design System

Components · Layout

Pane

One pane beside a conversation — its TabBar, the front object's row of buttons with its one ⋯, and its content.

ExperimentalAlso called PaneRoot, PaneToolRow, PaneBody, Editor group, Tool row
import { Pane } from "@botiverse/raft-ui/wip";

A pane holds one object at a time from its tabs: its TabBar, then the front object's row of buttons (only where the object has buttons of its own), then its content. PaneRoot is the pane, PaneToolRow the row and PaneBody the content (Tabs and panes).

pane/compositions/preview

When to use

SituationUse
An object open beside a conversation, with tabsPane
A side panel with a header of its own (a thread, a profile)Panel
Several panes side by side or stackedPaneGrid, with a Pane in each cell

Anatomy

  • PaneRoot: the pane, a column. focused marks the pane the keyboard and the app's shortcuts act on (data-focused).
  • A TabBar.
  • PaneToolRow: the front object's row. Its buttons are a FitToolbar named by label; the object's ⋯, from menu, sits after it. Optional.
  • PaneBody: the content, which fills the rest. A page laid over the pane from a fixed layer takes this box.

Behavior

  • The row holds the object's own buttons, as its row has them today, nothing invented, then one ⋯ at its end with the object's actions, for every kind of object. A page's row (an App's or a web page's) is its head bar of today, an App's included, or its address row, and its ⋯ holds the page's actions: Copy link address, Open in browser, Reload, and Mute or Unmute. The tab's menu holds none of them.
  • The row never holds the pane's controls: Maximize is on the TabBar, Close and Move in the tab's menu.
  • As the pane narrows, the buttons give way in the order the module gives them, labels first, then into the toolbar's More, as FitToolbar does. The ⋯ never folds.
  • When the ⋯ closes, focus goes back to it, unless menuHandsFocus says the chosen item moved it on: a dialog, a panel, a find bar.
  • A pointer press anywhere in a pane is the app's to turn into focus, with onPointerDownCapture on PaneRoot; opening a menu doesn't move it.

Content

  • Name the row after its object: "Document tools", "Page tools", "Task tools".
  • Name the ⋯ as the object's ⋯ is named today: More actions by default, Task actions for a task.

Accessibility

  • The row is a toolbar: one Tab stop, the arrow keys inside (FitToolbar). The ⋯ is the next Tab stop, a button with aria-haspopup="menu" and a tooltip.
  • Moving between panes (F6 and Shift+F6) is the app's; it sets focused and marks the pane once.
  • PaneBody is a plain box. While it shows the front tab's content, give it role="tabpanel", the id the tab's aria-controls names, and aria-labelledby the tab's id (Tab).

Rules

  • Put at most one ⋯ in a pane, at the end of its row, with the object's actions only.
  • Leave the row out for an object with no buttons of its own; don't draw an empty row.
  • Never put Maximize, Close or Move in the row.

API

PaneBody

Experimental

Takes the attributes of its element.

PaneRoot

ExperimentalOne pane: its `TabBar`, then the front tab's `PaneToolRow` (only where the object has buttons of its own), then `PaneBody`.
PropTypeDefault
focusedThe pane the keyboard and the app's shortcuts act on, one at a time across the row (`data-focused`). The app sets it, on a pointer press anywhere in the pane for instance (`onPointerDownCapture`).booleanfalse

Also takes the attributes of its element.

PaneToolRow

ExperimentalA pane's second row: the front object's own buttons, then one ⋯ with the object's actions. Never the pane's controls (maximize, close): those are on the TabBar and in the tab's menu. The buttons are a `FitToolbar`: one Tab stop, the arrow keys inside, and they give way as the pane narrows. The ⋯ sits after the toolbar and never folds.
PropTypeDefault
children (required)The front object's own buttons, as `FitToolbar` items: they give way as the pane narrows.ReactNode
label (required)The toolbar's accessible name: "Document tools", "Page tools".string
menuThe object's ⋯ at the row's end: `DropdownMenu` items, the object's own actions. Never the tab's or the pane's (those are in the tab's menu). Without it there is no ⋯: a page's actions lead its tab's menu.ReactNode
menuHandsFocusRead once as the ⋯ closes: true when the item chosen moved focus on (a dialog, a panel, a find bar); otherwise focus returns to the ⋯.() => boolean
menuLabelThe ⋯'s name and tooltip.string"More actions"

Also takes the attributes of its element.