Skip to content

[Feat] Add EuiBanner component#9673

Open
mgadewoll wants to merge 10 commits into
elastic:mainfrom
mgadewoll:feat/banner-component
Open

[Feat] Add EuiBanner component#9673
mgadewoll wants to merge 10 commits into
elastic:mainfrom
mgadewoll:feat/banner-component

Conversation

@mgadewoll
Copy link
Copy Markdown
Contributor

@mgadewoll mgadewoll commented May 21, 2026

Summary

This PR adds a new EuiBanner component.
This component is based on the previous Kibana custom implementation of AnnouncementBanner (PR)

Screenshot 2026-05-21 at 15 36 14

API Changes

prop required type default value description
title required string - Banner title
text - ReactNode - Banner body text. Avoid using for complex non-text content.
media required ReactNode - Illustration slot. Use to pass in an image or svg.
size - s | m - Defines the banner sizing and adjusts breakpoint behavior
color - highlighted | plain highlighted Defines the banner color variant.
actionProps - { primary: EuiBannerActionPrimaryProps, secondary: EuiBannerActionSecondaryProps } undefined Use to render action buttons. Standalone secondary buttons are not supported.
onDismiss - () => void undefined If provided, a dismiss button will be rendered.
dismissButtonProps - EuiButtonIconProps undefined Props to pass to the dismiss EuiButtonIcon
headingElement - h2 | h3 | h4 | h5 | h6 h2 Defines the rendered heading DOM element for the title
announceOnMount - boolean false When set to true, the content is announced by screen readers on mount.

Screenshots

size light dark
m Screenshot 2026-05-21 at 15 24 13 Screenshot 2026-05-21 at 15 24 17
s Screenshot 2026-05-21 at 15 25 35 Screenshot 2026-05-21 at 15 25 42

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?
  • 💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.
  • 🧪 Test impact — May break functional or snapshot tests (e.g., HTML structure, class names, default values).
  • 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.

Impact level: 🟢 None
This is a new component that's not used so far.

ℹ️ Kibana is using the custom AnnouncementBanner component, which we should update to return EuiBanner instead.

Release Readiness

  • Documentation: EuiBanner
  • Figma: Banner specs
  • Migration guide: {steps or link, for breaking/visual changes or deprecations}
  • Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}

QA instructions for reviewer

💻 EuiBanner storybook

  • verify EuiBanner matches design specs
  • verify EuiBanner props work as expected

Checklist before marking Ready for Review

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@mgadewoll mgadewoll self-assigned this May 21, 2026
@mgadewoll mgadewoll force-pushed the feat/banner-component branch from 69eee87 to d73c61e Compare May 21, 2026 13:51
@mgadewoll mgadewoll requested a review from ek-so May 21, 2026 15:15
@mgadewoll mgadewoll requested a review from acstll May 21, 2026 15:32
@mgadewoll mgadewoll marked this pull request as ready for review May 21, 2026 15:32
@mgadewoll mgadewoll requested a review from a team as a code owner May 21, 2026 15:32
Copilot AI review requested due to automatic review settings May 21, 2026 15:32
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

Adds a new EuiBanner announcement component to EUI, along with Storybook/docs coverage and i18n token wiring, to support full-width promotional/informational messaging similar to Kibana’s prior AnnouncementBanner.

Changes:

  • Introduces EuiBanner component implementation, styles, Storybook stories, and RTL unit tests
  • Adds new docs page for Banner and exposes the component via the public components index
  • Updates i18n tokens and adds a changelog entry

Reviewed changes

Copilot reviewed 8 out of 17 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/website/docs/components/display/banner.mdx Adds EuiBanner documentation, usage examples, and prop table
packages/eui/src/components/index.ts Exports the new banner component entry point
packages/eui/src/components/banner/index.ts Public export surface for EuiBanner and its props
packages/eui/src/components/banner/banner.tsx Implements EuiBanner UI, actions, dismiss, and live announcement behavior
packages/eui/src/components/banner/banner.styles.ts Emotion styles, including container-query based responsive layouts
packages/eui/src/components/banner/banner.stories.tsx Storybook stories and interactive playground scenarios
packages/eui/src/components/banner/banner.test.tsx RTL unit tests for rendering, props, actions, dismiss, and live region behavior
packages/eui/i18ntokens.json Adds i18n token for the dismiss button aria-label (plus regen reordering)
packages/eui/changelogs/upcoming/9673.md Changelog entry for new component

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/eui/src/components/banner/banner.test.tsx Outdated
Comment thread packages/eui/src/components/banner/banner.test.tsx Outdated
Comment thread packages/eui/src/components/banner/banner.stories.tsx Outdated
Comment thread packages/eui/src/components/banner/banner.tsx
Comment thread packages/eui/src/components/banner/banner.tsx Outdated
Comment thread packages/eui/src/components/banner/banner.tsx Outdated
Comment thread packages/website/docs/components/display/banner.mdx Outdated
@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants