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

Function CloseButton

starters/hooks/src/Modal.tsx:93–103  ·  view source on GitHub ↗
({children = 'Close'}: CloseButtonProps)

Source from the content-addressed store, hash-verified

91}
92
93export function CloseButton({children = 'Close'}: CloseButtonProps) {
94 let state = useContext(OverlayStateContext);
95 return (
96 <Button
97 onPress={() => state?.close()}
98 className="react-aria-Button button-base"
99 data-variant="primary">
100 {children}
101 </Button>
102 );
103}

Callers

nothing calls this directly

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected