MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Sheet

Function Sheet

starters/docs/src/Sheet.tsx:27–50  ·  view source on GitHub ↗
({children, ...props}: SheetProps)

Source from the content-addressed store, hash-verified

25}
26
27export function Sheet({children, ...props}: SheetProps) {
28 let {snapPoints, preventDismissal} = props;
29 return (
30 <SheetOverlay {...props} style={undefined}>
31 {/* The backdrop fades in as the sheet slides up. When snap points are used, it stays hidden
32 until the sheet is dragged past the last snap point. */}
33 <SheetBackdrop
34 swipeAnimation="sheet-backdrop"
35 swipeAnimationRange={snapPoints ? {start: snapPoints.length - 1} : undefined}
36 />
37 {/* overscrollPadding makes the sheet appear to continue past the edge of the screen when overscrolled.
38 The scaleBack animation scales a parent sheet backward when a child sheet is opened on top of it. */}
39 <RACSheet
40 overscrollPadding={props.overscrollPadding ?? true}
41 swipeAnimation={props.swipeAnimation}
42 swipeAnimationRange={props.swipeAnimationRange}
43 stackAnimation="sheet-scale-back"
44 style={props.style}>
45 {!preventDismissal && <div className="sheet-handle" />}
46 <SheetContent>{children}</SheetContent>
47 </RACSheet>
48 </SheetOverlay>
49 );
50}
51
52export {Heading};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected