Skip to content

Behaviour props ​

These options control how a sheet behaves. Every one has a default from the variant; pass a value to override it.

PropTypeDefaultDescription
behavior'modal' | 'nonModal' | 'persistent'from variantHow the sheet relates to the screen beneath
enableDragbooleantrue for sheets, top, fullScreenViewerDrag to resize and swipe to dismiss
enableBackdropbooleantrue for modal behaviourDim the screen beneath
enableKeyboardbooleantrue except alert, picker and overlaysKeep inputs above the keyboard
enableNestedScrollbooleantrue except action, share, alert and overlaysLet inner scroll views scroll before the sheet drags
hardwareBackDismissbooleantrue (false for loadingOverlay)Android back button / web Escape closes it
autoDismissMsnumber > 0toast 3000, snackbar 4000, in-app notification 5000Close automatically
marginnumber ≥ 016 for floating placements, else 0Gap from the screen edges
anchor{x, y, width, height}—Required for anchored overlays
side'left' | 'right''right'For the side variant
accessibilityLabelstring—Screen-reader label of the surface

behavior ​

ValueScreen beneathBackdrop defaultdismiss() / dismissAll()Backdrop tap closes
modalblockedoncloses ityes
nonModalusableoffcloses it—
persistentusableoffskips it—
tsx
// A filter panel the user can keep open while scrolling the list behind it.
sheet.present({
  id: 'filters',
  variant: 'filter',
  behavior: 'nonModal',
  snapPoints: ['30%', '70%'],
  content: <Filters />,
});

enableDrag ​

With enableDrag: false the sheet can't be dragged or swiped away. On iOS it also can't be pulled down. Close it from code.

tsx
sheet.present({id: 'terms', content: <Terms onAccept={accept} />, enableDrag: false});

autoDismissMs ​

tsx
sheet.present({id: 'hint', variant: 'tooltip', anchor, content: <Hint />, autoDismissMs: 4000});

The timer restarts when you update or replace the sheet, and stops when it is dismissed.

Platform notes ​

enableKeyboard and enableNestedScroll are part of the shared contract and are honoured on the web. On iOS and Android the platform's default keyboard and scroll handling applies for now. See Keyboard & scrolling.

Released under the MIT License.