RightPanel
Panel with a header and scrolling body for the AppShell right panel
pnpm add @wandercom/design-system-web
RightPanel is the content of AppShell's right panel, such as Ask Wander or Help. It's built from PageShell, so its radius, border, fill, header and scrolling body match the canvas. It has no content of its own.
import { RightPanel } from '@wandercom/design-system-web/blocks/right-panel';
import { DropdownItem } from '@wandercom/design-system-web/ui/dropdown';
<AppShell.Panel>
<RightPanel>
<RightPanel.Header>
<RightPanel.Back onClick={showList} />
<RightPanel.Title icon={<IconHelp />}>Help</RightPanel.Title>
<RightPanel.Actions>
<RightPanel.MoreMenu>
<DropdownItem>Contact support</DropdownItem>
</RightPanel.MoreMenu>
</RightPanel.Actions>
<RightPanel.Close />
</RightPanel.Header>
<RightPanel.Body>…</RightPanel.Body>
</RightPanel>
</AppShell.Panel>The parts are also available as RightPanelHeader, RightPanelBack, RightPanelTitle, RightPanelActions, RightPanelMoreMenu, RightPanelClose and RightPanelBody.
The header holds, in order: an optional back button for nested views, the title with an optional icon, optional actions such as a ••• menu, and the close button.
The title renders an h2, since the canvas holds the page's h1. The panel is labelled by its title.
Inside AppShell, RightPanel.Close closes the panel by calling onPanelOpenChange(false). Call event.preventDefault() in its onClick to keep the panel open, such as to confirm discarding a draft. Outside AppShell, handle onClick yourself.
The body scrolls separately from the canvas, and a divider appears under the header once it scrolls, like PageShellBody. For content that scrolls itself, such as ChatComposed, give the body overflow-hidden.