feat(banner): add action prop for CTA buttons in structured mode#323
Merged
geoquant merged 3 commits intocloudflare:mainfrom Mar 27, 2026
Merged
feat(banner): add action prop for CTA buttons in structured mode#323geoquant merged 3 commits intocloudflare:mainfrom
action prop for CTA buttons in structured mode#323geoquant merged 3 commits intocloudflare:mainfrom
Conversation
Add an `action?: ReactNode` slot prop to Banner that renders at the trailing end of the banner in structured mode (when using title/description). This lets consumers add CTA buttons without falling back to the children prop, which can't be combined with title/description. Layout uses flex with min-w-0/flex-1 on the content area and shrink-0 on the action slot to keep buttons from being squeezed. - Add action prop to BannerProps interface - Update structured mode render to include action slot - Add BannerWithActionDemo and BannerWithActionsDemo - Add 'With action' and 'With multiple actions' sections to docs - Add changeset (minor)
commit: |
Contributor
Docs PreviewCommit: |
Contributor
mattrothenberg
approved these changes
Mar 27, 2026
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.

































Summary
Adds an
action?: ReactNodeslot prop to the Banner component, rendered at the trailing end of the banner in structured mode (when usingtitleordescription). This lets consumers add CTA buttons or a dismiss icon without falling back to thechildrenprop, which can't be combined withtitle/description.Changes
packages/kumo/src/components/banner/banner.tsx— Addedactionprop toBannerProps; renders in ashrink-0flex container to the right of the title/description content areapackages/kumo-docs-astro/src/components/demos/BannerDemo.tsx— AddedBannerWithActionDemo(CTA button + dismissable X icon),BannerWithActionsDemo(multiple buttons)packages/kumo-docs-astro/src/pages/components/banner.mdx— Added "With action" and "With multiple actions" doc sections.changeset/banner-action-slot.md— Minor changesetUsage
Notes
children/textcode pathactionis only rendered in structured mode (whentitleordescriptionis set)flexwithmin-w-0 flex-1on content andshrink-0on action slot