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

Function MyToastRegion

starters/docs/src/Toast.tsx:37–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35});
36
37export function MyToastRegion() {
38 return (
39 // The ToastRegion should be rendered at the root of your app.
40 <ToastRegion queue={queue}>
41 {({toast}) => (
42 <MyToast toast={toast} style={{viewTransitionName: toast.key} as CSSProperties}>
43 <ToastContent>
44 <Text slot="title">{toast.content.title}</Text>
45 {toast.content.description && (
46 <Text slot="description">{toast.content.description}</Text>
47 )}
48 </ToastContent>
49 <Button slot="close" aria-label="Close" variant="quiet">
50 <X size={16} />
51 </Button>
52 </MyToast>
53 )}
54 </ToastRegion>
55 );
56}
57
58export function MyToast(props: ToastProps<MyToastContent>) {
59 return <Toast {...props} />;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected