Skip to content

Add alignment and size props to AlertBanner#678

Merged
mkernohanbc merged 6 commits into
mainfrom
feature/alert-banner
May 25, 2026
Merged

Add alignment and size props to AlertBanner#678
mkernohanbc merged 6 commits into
mainfrom
feature/alert-banner

Conversation

@mkernohanbc
Copy link
Copy Markdown
Contributor

This PR makes two non-breaking changes to AlertBanner, responding to insights surfaced by the CMS team:

Sizing

The size prop controls the vertical padding and font size on the banner, to make it more flexible for use in complex/constrained UI. size defaults to medium (current behaviour), but can also be set to small:

Screenshot 2026-04-30 at 10 26 34 AM

Alignment

The alignment prop controls the horizontal padding and the width of the children container. Again, this is designed to make it more flexible. alignment defaults to center (current behaviour), but can also be set to stretch:

Screenshot 2026-04-30 at 10 28 18 AM

@mkernohanbc mkernohanbc added this to the Components v0.8.0 milestone Apr 30, 2026
@mkernohanbc mkernohanbc self-assigned this Apr 30, 2026
@mkernohanbc mkernohanbc added the Components Changes or issues affect the design-system-react-components package label Apr 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 extends AlertBanner with configurable sizing and alignment so it can fit more constrained or full-width layouts while preserving current defaults.

Changes:

  • Adds size and alignment props to AlertBanner and maps them to CSS classes.
  • Adds CSS rules for small/medium sizing and center/stretch alignment.
  • 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.

Comment thread packages/react-components/src/components/AlertBanner/AlertBanner.tsx Outdated
Copy link
Copy Markdown
Contributor

@ty2k ty2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This works but the naming of the alignment prop and its choice names should be changed.

Comment thread packages/react-components/src/components/AlertBanner/AlertBanner.tsx Outdated
Copy link
Copy Markdown
Contributor

@ty2k ty2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mkernohanbc mkernohanbc merged commit e1c6295 into main May 25, 2026
5 checks passed
@mkernohanbc mkernohanbc deleted the feature/alert-banner branch May 25, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Components Changes or issues affect the design-system-react-components package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants