Command Palette

Search for a command to run...

Detail Panel

A panel at the window's right edge that opens a list row's detail, pushing the list aside when there is room and sliding over it when there is not.

Usage

import { DetailPanel } from "@smartacteam/ambient-web/detail-panel";
<DetailPanel.Root open={open} onClose={close}>
  <DetailPanel.Main>{/* the list */}</DetailPanel.Main>
  <DetailPanel.Panel title="Order snapshot">
    {/* the detail */}
  </DetailPanel.Panel>
</DetailPanel.Root>

Push or slide over

The panel is fixed to the window's right edge. While it is open, Root measures how much of its own width the panel covers and how much room is left of the panel:

  • Push: when that room is at least minMainWidth, Main gives up the covered width, so the list stays in reach beside the detail. A layout that ends short of the window's edge gives up only the part the panel covers.
  • Slide over: when the panel overlaps Root and that room is under minMainWidth, Main keeps its width and the panel covers it with a subtle shadow (shadow-lg).

The push leaves that room alone, so opening the panel cannot flip the choice; a resize of the window or of Root while open switches it.

The panel moves focus into itself when it opens and back to the opener when it closes. Escape closes it unless something inside, such as a menu, handled the key first.

Root API Reference

PropTypeDefault
openboolean
onClose() => void
panelWidthnumber400
minMainWidthnumber640