Skip to content

feat(NavigationCard): Add navigation card built on CardFrame - #4063

Merged
m7kvqbe1 merged 2 commits into
masterfrom
feature/navigation-card
Aug 3, 2026
Merged

feat(NavigationCard): Add navigation card built on CardFrame#4063
m7kvqbe1 merged 2 commits into
masterfrom
feature/navigation-card

Conversation

@m7kvqbe1

@m7kvqbe1 m7kvqbe1 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Related issue

N/A

Overview

Adds a new NavigationCard component: a clickable card built on the existing CardFrame primitive, with a themed icon panel, a title, an optional description and a chevron affordance. Intended for landing/home screens that link into the major areas of an app.

Link to preview

N/A

Reason

Consuming apps have been hand-rolling bespoke "clickable card" navigation on their landing pages. This provides a single, accessible, tokenised component so those snowflakes can be replaced with a shared one.

Work carried out

  • NavigationCard built on CardFrame, with a themed icon panel, title, optional description and chevron
  • Whole card clickable via a stretched ::after on the supplied link, keeping a single element in the accessibility tree (icon and chevron aria-hidden)
  • Framework-agnostic link prop (mirrors SidebarNavItem) so consumers pass their own next/link / router Link / <a>
  • color prop from NAVIGATION_CARD_COLOR (action | success | warning | danger | neutral, default action) driving icon panel, chevron and hover/focus states
  • Constants/types (ValueOf), partials/ with barrel, ComponentWithClass + JSDoc props, registered in the package barrel
  • Storybook stories under Components/Navigation Card (Default with controls, WithoutIcon, Colours)
  • Unit tests (RTL + jest-styled-components) — title/href, description, icon presence/absence, chevron, className pass-through, prop spread, link click, per-colour tint

Screenshot

2026-07-30 17 21 28

Developer notes

  • The card intentionally has no nested <button>: a real button can't live inside the card-wide link, so the whole card is the link and the chevron signals navigation.
  • The consumer's link element supplies the title text; its descendant anchor is styled and stretched — no cloneElement needed.
  • types, lint and the component test suite pass locally.

@chromatic-com

chromatic-com Bot commented Jul 30, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 4 changes accepted as baselines
🟢 UI Review: Approved by Tom Humphris
Storybook icon Storybook Publish: 258 stories published

@m7kvqbe1 m7kvqbe1 self-assigned this Jul 30, 2026
@m7kvqbe1 m7kvqbe1 added Type: Enhancement New feature or request Package: react-component-library Package/code type labels Jul 30, 2026

@markhigham markhigham left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM Some FYI comments.

  • Mixed grids with and without icons. The icon panel disappears entirely when no icon is passed, so a grid mixing both variants gets ragged left alignment and inconsistent card heights. If mixing is expected, the docs should say "don't," or the layout should reserve the space.

  • Text selection is dead. The stretched overlay sits over the description, so users can't select/copy the description text. For "Browse and download all received files" that's probably fine, but if descriptions ever carry
    meaningful data (filenames, counts), it'll frustrate people. Worth deciding consciously.

@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@m7kvqbe1
m7kvqbe1 merged commit a0c06dd into master Aug 3, 2026
19 checks passed
@m7kvqbe1
m7kvqbe1 deleted the feature/navigation-card branch August 3, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Package: react-component-library Package/code type Type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants