Skip to content

Modal and Toast component z-index #4016

Discussion options

You must be logged in to vote

Hi @vignesh-sivaprakasam, by default the Toast component does not have the zIndex styling. It's actually applied to the toast container (Toaster) that is used with the hook. I have forked off of your sandbox to show an example of the toast being pushed when the "Done" button is clicked in this example. For reference the Modal overlay zIndex is 80 and the Toaster component is 90.

The main code change is:

...
  const toaster = useToaster();

  const addToast = () =>
    toaster.push({
      message: "Your function is currently being deployed.",
      variant: "neutral",
      id: "custom_id",
      dismissAfter: 4000,
      onDismiss: () => alert("dismissed"),
    });

  return (
    <div>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by serifluous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants