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

Function Sheet

starters/tailwind/src/Sheet.tsx:54–75  ·  view source on GitHub ↗
({children, ...props}: SheetProps)

Source from the content-addressed store, hash-verified

52}
53
54export function Sheet({children, ...props}: SheetProps) {
55 let {snapPoints} = props;
56 return (
57 <SheetOverlay {...props} className={composeTailwindRenderProps(props.className, 'group/sheet')}>
58 {/* The backdrop fades in as the sheet slides up. When snap points are used, it stays hidden
59 until the sheet is dragged past the last snap point. */}
60 <SheetBackdrop
61 className={backdropStyles()}
62 swipeAnimation="sheet-backdrop"
63 swipeAnimationRange={snapPoints ? {start: snapPoints.length - 1} : undefined}
64 />
65 {/* overscrollPadding makes the sheet appear to continue past the edge of the screen when overscrolled.
66 The scaleBack animation scales a parent sheet backward when a child sheet is opened on top of it. */}
67 <RACSheet
68 overscrollPadding={props.overscrollPadding ?? true}
69 stackAnimation="sheet-scale-back"
70 className={({position}) => sheetStyles({position})}>
71 <SheetContent className={contentStyles()}>{children}</SheetContent>
72 </RACSheet>
73 </SheetOverlay>
74 );
75}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected