Repository navigation
Card: incorporate adoption feedback - #8592
Conversation
🦋 Changeset detectedLatest commit: 237c463 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Add optional shadows and whole-card heading actions, standardize padding, and improve custom card layouts. Record the default padding change as breaking; migration planning remains follow-up work. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add opt-in regular padding for 16px in either layout and replace the breaking padding changeset with a minor release note. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8303bc0 to
7c70f4b
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review. Note You can configure setup steps for Copilot code review separately from Copilot cloud agent with a |
There was a problem hiding this comment.
🟡 Changes recommended
Story playback can overlap the Card test interactions and assertions, creating race conditions and extra clicks unless tests wait for playback completion or use playback-free stories.
1 open issue
What changed in this PR
This PR incorporates adoption feedback into the draft Card component, adding whole-card interactions and layout options without changing default padding or promoting Card to alpha.
Changes:
- Add
Card.Link,Card.Button, optional shadows, and opt-in 16px padding. - Improve shrinking, equal-height layouts, footer alignment, and edge-to-edge images.
- Expand documentation, stories, interaction tests, and public export coverage.
| File | Description |
|---|---|
packages/react/src/experimental/index.ts |
Export new interaction prop types. |
packages/react/src/Card/index.ts |
Expose Card.Link and Card.Button. |
packages/react/src/Card/Card.tsx |
Implement interaction components and layout options. |
packages/react/src/Card/Card.test.tsx |
Cover layout, padding, shadows, and native interactions. |
packages/react/src/Card/Card.stories.tsx |
Add padding and shadow controls. |
packages/react/src/Card/Card.stories.module.css |
Style equal-height custom compositions. |
packages/react/src/Card/Card.module.css |
Add interaction indicators and improve layout behavior. |
packages/react/src/Card/Card.features.stories.tsx |
Demonstrate whole-card and independent secondary actions. |
packages/react/src/Card/Card.docs.json |
Document new APIs and composition constraints. |
packages/react/src/__tests__/__snapshots__/exports.test.ts.snap |
Record new public prop types. |
e2e/components/Card.test.ts |
Test whole-card interactions, layout, and accessibility. |
.changeset/card-flexible-layout.md |
Describe layout fixes in a patch changeset. |
.changeset/card-adoption-feedback.md |
Describe new Card APIs in a minor changeset. |
Review effort: Balanced
| await visit(page, {id: 'experimental-components-card-features--with-button'}) | ||
| const details = page.getByRole('region', {name: 'Repository details'}) | ||
| await expect(details).toHaveCount(0) |
Keep heading actions local by default and opt in with fullCardHitArea. Add 24px spacious padding in both layouts while preserving normal padding and defaults. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
|
|
Integration test results from github/github-ui PR: |
|
the CodeViewEmptyLayout |

Related to github/primer#6672.
Address Card adoption feedback. Card remains draft; alpha promotion is out of scope.
Changelog
New
shadow={false}for shadowless cards.Card.LinkandCard.Buttonfor whole-card interaction, with hover/focus indicators and independent secondary controls.padding="regular"for 16px padding in either layout.Changed
Removed
None.
Rollout strategy
Minor release. Existing default/
normalpadding stays 24px in the default layout and 16px in compact layout. The new 16px option is opt-in; no padding migration is needed.Testing & Reviewing
npm run build— passed locally.npm test -- --run packages/react/src/__tests__/exports.test.ts packages/react/src/Card/Card.test.tsx— 64 passed locally.npx playwright test e2e/components/Card.test.ts --grep 'Whole-card interactions' --workers=2— 11 passed locally, including accessibility checks.npm run format:diff— passed locally.Review padding/shadow in Playground and keyboard/pointer behavior in With Link, With Button, and Custom Content.