-
Notifications
You must be signed in to change notification settings - Fork 173
feat: expose zindex in toast #3035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 8eba91c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
✅ PR title follows Conventional Commits specification. |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8eba91c:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for custom z-index values in Toast components, allowing toasts to be positioned above or below other UI elements with specific z-index requirements.
- Adds a
zIndexprop toToastPropstype definition - Implements dynamic container z-index calculation based on custom toast z-index values
- Maintains relative stacking order where newer toasts appear above older ones
- Includes comprehensive Storybook examples demonstrating toast positioning above modals
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/blade/src/components/Toast/types.ts | Adds optional zIndex property to ToastProps type |
| packages/blade/src/components/Toast/ToastContainer.web.tsx | Implements z-index calculation logic for container and individual toast wrappers |
| packages/blade/src/components/Toast/Toast.stories.tsx | Adds ZIndex story demonstrating custom z-index usage with modal overlay examples |
| .changeset/kind-mayflies-fetch.md | Documents the feature addition as a minor version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🛡️ Coverage ReportSummaryFull Coverage Details |
| * Custom z-index value for the toast container. | ||
| * This is useful when you want to position toasts above other elements like modals. | ||
| * | ||
| * @default 2000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default zIndex should be more than Modal.
In the TOAST_Z_INDEX also add 1 liner
// Because more than modal
const TOAST_Z_INDEX = 2001;
Description
Changes
Additional Information
Component Checklist