Stacksheetv1.1.4

Config

Full StacksheetConfig reference with all options and defaults.

Pass configuration to createStacksheet():

const { StacksheetProvider, useSheet } = createStacksheet({
  side: "right",
  width: 480,
  spring: "snappy",
  closeOnEscape: true,
});

Options

OptionTypeDefaultDescription
maxDepthnumberInfinityMaximum stack depth
closeOnEscapebooleantrueClose on ESC key
closeOnBackdropbooleantrueClose on backdrop click
showOverlaybooleantrueShow backdrop overlay
lockScrollbooleantrueLock body scroll when open
widthnumber420Panel width in px
maxWidthstring"90vw"Maximum panel width (CSS value)
breakpointnumber768Mobile breakpoint in px
sideSideConfig{ desktop: "right", mobile: "bottom" }Sheet slide-from side
stackingPartial<StackingConfig>Stacking visual parameters
springSpringPreset | Partial<SpringConfig>"stiff"Spring animation config
zIndexnumber100Base z-index
ariaLabelstring"Sheet dialog"Default aria-label for dialog panels
onOpenComplete() => voidCalled when top panel entrance animation completes
onCloseComplete(reason: CloseReason) => voidCalled when last panel exit animation completes. See Callbacks.
dragbooleantrueEnable drag-to-dismiss
closeThresholdnumber0.25Fraction of panel to trigger close (0–1)
velocityThresholdnumber0.5Velocity in px/ms to trigger close
dismissiblebooleantrueMaster switch for dismissal (drag + backdrop + escape)
modalbooleantrueModal mode (overlay + scroll lock + focus trap)
shouldScaleBackgroundbooleanfalseScale [data-stacksheet-wrapper] when open
scaleBackgroundAmountnumber0.97Background scale factor

Side

Controls which edge the sheet slides from.

A string applies to all viewports. An object sets different sides for desktop and mobile:

// Always right
createStacksheet({ side: "right" });

// Right on desktop, bottom on mobile (default)
createStacksheet({ side: { desktop: "right", mobile: "bottom" } });

// Left sidebar
createStacksheet({ side: "left" });

Available sides: "left" | "right" | "bottom"

Stacking

Controls the Apple-style depth effect when sheets are stacked:

OptionDefaultDescription
scaleStep0.04Scale reduction per depth level
offsetStep16Pixel offset per depth level (shifts panels away from the stack edge)
opacityStep0Opacity reduction per depth level
radius12Border radius on stacked panels in px
renderThreshold3Max depth before content stops rendering
createStacksheet({
  stacking: { scaleStep: 0.06, opacityStep: 0.1, radius: 14 },
});

Springs

Spring presets control animation feel. Pass a preset name or a custom config:

PresetStiffnessDampingMassFeel
"subtle"300301Barely noticeable bounce
"snappy"400280.8Quick, responsive
"stiff"400401Default. Very quick, controlled
// Preset
createStacksheet({ spring: "snappy" });

// Custom
createStacksheet({
  spring: { stiffness: 300, damping: 25, mass: 0.9 },
});

The same spring drives all animations — entrance, stacking transforms, and exit — so everything feels cohesive.

Drag

Sheets can be dismissed by dragging them in the direction they came from. Enabled by default. See Drag to Dismiss for the full gesture pipeline, data attributes, and handle-only patterns.

createStacksheet({ drag: false }); // disable drag only
createStacksheet({ dismissible: false }); // disable all dismissal

Set modal: false to skip the backdrop overlay, focus trap, and scroll lock. See Non-Modal Mode for the comparison table and use cases.

createStacksheet({ modal: false });

Snap points

Bottom sheets can snap to predefined heights instead of only fully open or fully closed. See Snap Points for the full API and examples.

createStacksheet({
  side: "bottom",
  snapPoints: [0.25, 0.5, 1],
});

Body scale

Scale down your page content when sheets open for an iOS-style depth effect. See Body Scale Effect for setup and wrapper placement.

createStacksheet({ shouldScaleBackground: true });

On this page