Add alignment and size props to AlertBanner#678
Merged
Conversation
Philip-Cheung
approved these changes
Apr 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends AlertBanner with configurable sizing and alignment so it can fit more constrained or full-width layouts while preserving current defaults.
Changes:
- Adds
sizeandalignmentprops toAlertBannerand maps them to CSS classes. - Adds CSS rules for
small/mediumsizing andcenter/stretchalignment. - Documents and demonstrates the new props in Storybook.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/react-components/src/components/AlertBanner/AlertBanner.tsx |
Adds new public props and includes them in the root class list. |
packages/react-components/src/components/AlertBanner/AlertBanner.css |
Moves padding/font/max-width behavior behind size and alignment selectors. |
packages/react-components/src/stories/AlertBanner.stories.tsx |
Adds Storybook controls and example stories for the new prop values. |
packages/react-components/src/stories/AlertBanner.mdx |
Adds documentation sections for sizing and alignment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ty2k
requested changes
May 25, 2026
Contributor
ty2k
left a comment
There was a problem hiding this comment.
Nice! This works but the naming of the alignment prop and its choice names should be changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes two non-breaking changes to
AlertBanner, responding to insights surfaced by the CMS team:Sizing
The
sizeprop controls the vertical padding and font size on the banner, to make it more flexible for use in complex/constrained UI.sizedefaults tomedium(current behaviour), but can also be set tosmall:Alignment
The
alignmentprop controls the horizontal padding and the width of thechildrencontainer. Again, this is designed to make it more flexible.alignmentdefaults tocenter(current behaviour), but can also be set tostretch: