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

Function MyToastRegion

starters/tailwind/src/Toast.tsx:38–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36});
37
38export function MyToastRegion() {
39 return (
40 // The ToastRegion should be rendered at the root of your app.
41 <ToastRegion
42 queue={queue}
43 className="fixed bottom-4 right-4 flex flex-col-reverse gap-2 rounded-lg outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2">
44 {({toast}) => (
45 <MyToast toast={toast}>
46 <ToastContent className="flex flex-col flex-1 min-w-0">
47 <Text slot="title" className="font-semibold text-white text-sm">
48 {toast.content.title}
49 </Text>
50 {toast.content.description && (
51 <Text slot="description" className="text-xs text-white">
52 {toast.content.description}
53 </Text>
54 )}
55 </ToastContent>
56 <Button
57 slot="close"
58 aria-label="Close"
59 className="flex flex-none appearance-none w-8 h-8 rounded-sm bg-transparent border-none text-white p-0 outline-none hover:bg-white/10 pressed:bg-white/15 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-white focus-visible:outline-offset-2 items-center justify-center [-webkit-tap-highlight-color:transparent]">
60 <XIcon className="w-4 h-4" />
61 </Button>
62 </MyToast>
63 )}
64 </ToastRegion>
65 );
66}
67
68export function MyToast(props: ToastProps<MyToastContent>) {
69 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected