A required root-level provider that creates the DOM containers for CDS overlay components (Modal, Toast, Alert, Tooltip, Tray) and manages overlay state.
You can disable the default portal rendering and use the PortalNodes component separately:
Loading...
Live Code
functionExample(){return(<PortalProviderrenderPortals={false}><Boxpadding={4}borderedborderRadius={200}> Your app content</Box><PortalNodes/></PortalProvider>);}
The PortalProvider's toastBottomOffset prop sets the default bottom offset for all toasts:
Loading...
Live Code
functionExample(){functionToastDemo(){const toast =useToast();return(<Boxpadding={4}borderedborderRadius={200}><ButtononClick={()=> toast.show('This toast appears with a custom bottom offset (80px)')}> Show Toast</Button></Box>);}return(<PortalProvidertoastBottomOffset={80}><ToastDemo/></PortalProvider>);}