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

Function Dialog

starters/hooks/src/Modal.tsx:77–91  ·  view source on GitHub ↗
({title, children, ...props}: DialogProps)

Source from the content-addressed store, hash-verified

75}
76
77export function Dialog({title, children, ...props}: DialogProps) {
78 let ref = useRef<HTMLDivElement>(null);
79 let {dialogProps, titleProps} = useDialog(props, ref);
80
81 return (
82 <div {...dialogProps} ref={ref} className="react-aria-Dialog">
83 {title && (
84 <h3 {...titleProps} slot="title" className="react-aria-Heading">
85 {title}
86 </h3>
87 )}
88 {children}
89 </div>
90 );
91}
92
93export function CloseButton({children = 'Close'}: CloseButtonProps) {
94 let state = useContext(OverlayStateContext);

Callers

nothing calls this directly

Calls 1

useDialogFunction · 0.90

Tested by

no test coverage detected