Add secondary value slot to OverviewCard - #2416
Open
ravikiranvm wants to merge 2 commits into
Open
Conversation
Widen the value prop to ReactNode and add an optional secondaryValue rendered baseline-aligned to its right, so consumers can attach compact supplementary content (e.g. secondary amounts) or tooltip-wrapped values without changing the card's layout when the slot is unused. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the shared OverviewCard component in packages/ui-components to support richer value rendering and an optional secondaryValue slot for supplementary inline content, with a Storybook story documenting the new API.
Changes:
- Widen
valueprop type toReactNodeand add optionalsecondaryValue?: ReactNodeprop. - Render
value+secondaryValuein a baseline-aligned flex row within the card. - Add a
WithSecondaryValueStorybook story demonstrating the new slot.
Blocking
- Rendering
value: ReactNodeinside a<p>can produce invalid HTML and layout breakage if consumers pass block elements; use a non-paragraph wrapper for the value styling instead.
Non-blocking
- None
Merge recommendation
- Do not merge
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/ui-components/src/components/overview-card/overview-card.tsx | Extends the component API (value as ReactNode, adds secondaryValue) and updates layout to render both inline. |
| packages/ui-components/src/stories/overview-card/overview-card.stories.tsx | Adds a Storybook example (WithSecondaryValue) to document the new slot usage. |
The value prop accepts any ReactNode, and a p element only permits phrasing content — a block child would be invalid HTML. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
MarceloRGonc
approved these changes
Jul 30, 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.



Part of OPS-4666
Extends the
OverviewCardcomponent API to support supplementary content next to the main value.Additional Notes
Two additive, backward-compatible changes:
valueis widened fromstring | numbertoReactNode, so consumers can pass richer values (e.g. a tooltip-wrapped element) where needed. Plain strings and numbers render exactly as before.secondaryValue?: ReactNodeprop, rendered baseline-aligned to the right of the value inside a wrapping flex row. When the prop is unused the card renders identically to today (single flex child at baseline — no visual change).The immediate consumer is an upcoming dashboard KPI that shows compact secondary amounts beside the main value; the slot itself is generic. A
WithSecondaryValuestory documents the usage.