Skip to main content

SheetProps

Props for Sheet.

This is an interface exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import type { SheetProps } from "@mapcairn/map";

interface SheetProps

Properties​

brand​

readonly brand?: ReactNode;

A decorative brand (a host's mark and name) shown in a row above the title. It is aria-hidden, so the title stays the accessible name; pass nothing for no row. In the sheet layout the row is left out at the peek detent, where there is no room for it.

children​

readonly children: ReactNode;

The sheet's content, below its title.

detent​

readonly detent: SheetDetent;

The current detent. Used only in the sheet layout.

id​

readonly id: string;

The element id, for aria-controls on the control that opens it.

onClose​

readonly onClose: () => void;

The app's single close action (Close button and Escape).

onDetentChange​

readonly onDetentChange: (detent: SheetDetent) => void;

Called when the person moves the sheet to another detent. The app keeps it and passes it back as detent.

onModalChange​

readonly onModalChange?: (modal: boolean) => void;

Called with true while the sheet is modal (open at the full detent in the sheet layout), and false otherwise. The app passes it on to MapChrome's modal, which makes everything else inert.

open​

readonly open: boolean;

Whether the sheet is shown.

restoreFocus​

readonly restoreFocus?: () => void;

Called after the sheet closes, to put focus back where it came from.

testId​

readonly testId?: string;

Sets data-testid. Defaults to the id.

title​

readonly title: string;

The heading text, which also names the dialog or region.

See also​

Source: packages/map/src/chrome/Sheet/Sheet.tsx:54