Conversation
🦋 Changeset detectedLatest commit: 06edb74 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 |
|
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
|
@liuliu-dev should we tie the padding to the content-top, instead of icon bottom?
|
|
Uh oh! @lukasoppermann, at least one image you shared is missing helpful alt text. Check #7723 (comment) to fix the following violations:
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
|
|
This is also a use case: https://primer-1b76de82d9-13348165.drafts.github.io/storybook/?path=/story/components-card--custom-content
I am wondering if we should expect users to "bring their own padding" or if we should have a padding inside the card by default and a prop or a way to easily remove the default padding? CC: @siddharthkp ? |
|
Uh oh! @lukasoppermann, at least one image you shared is missing helpful alt text. Check #7723 (comment) to fix the following violations:
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
|
Amazing! Thank you so much! |
|
Thanks @lukasoppermann! Here's what I've updated based on your feedback:
|
|
@liuliu-dev perfect, thank you. |
I think bring your padding is a pattern we don't follow anywhere right now because it can lead to variation that is visibly inconsistent. Something we can take from PageLayout is the idea of |
The prop is now implemented, this makes sense to me. @siddharthkp the Pagelayout does not make total sense to me, because there seems to be no
This is important! 👍 |
My bad, the values in the docs are
I've come into this blind, so I don't actually know what's going on or what we are trying to do 😅 I would say however, we should put this in experimental and not root index right away |
packages/react/src/index.ts
Outdated
| CardDescriptionProps, | ||
| CardMenuProps, | ||
| CardMetadataProps, | ||
| } from './Card' |
There was a problem hiding this comment.
Should we export this from src/experimental/index until we build some confidence in the API with some usage?
There was a problem hiding this comment.
Whatever you folks feel is best. Do we have a clear path for how we move this out of experimental? It feels like stuff stays in experimental for way to long some times.
There was a problem hiding this comment.
Makes sense to keep it in experimental for now. It’s mostly upstreamed from Pacer so it’s not totally new, but the padding prop is new, if it looks good in usage we can move it out pretty quickly.
There was a problem hiding this comment.
Yep, but I would count pacer as super experimental too (and maybe deprecated).
It did not go through primer's patterns or accessibility process, so I'd like for us to be able to change our mind on the details
There was a problem hiding this comment.
^ which makes me wonder, @lukasoppermann are there any Card components as shared-components in github-ui that we should also consider as inventory?
Feels a bit strange to promote the experimental pacer component without looking at the other stable components that exist in github-ui
(Doesn't have to be blocking if we are putting this component in experimental, we can iterate over it before pushing for adoption)
There was a problem hiding this comment.
Moved Card to @primer/react/experimental, merging now, happy to iterate in the future!
|
Figma component: https://github.com/github/primer/issues/6537 |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/18126 |


Upstream the Card component from
Pacerinto@primer/react.Issue: https://github.com/github/primer/issues/6467
Changelog
New
Card— A styled container component with border, box-shadow, and border-radius; also supports custom content without subcomponents (plain container mode)Card.Icon— Renders a decorative icon in the card header (defaults toaria-hidden, supportsaria-labelfor meaningful icons)Card.Image— Renders an edge-to-edge image in the card headerCard.Heading— Renders a heading (defaults to h3, configurable viaasprop)Card.Description— Renders a description below the headingCard.Menu— Slot for overlay menu (positioned absolute top-right)Card.Metadata— Renders metadata content below the descriptionChanged
PlaygroundStorybook story updated with boolean toggle controls forCard.IconandCard.MetadataCustomContentStorybook story added to demonstrate usingCardas a plain styled container with arbitrary children (no subcomponents)Rollout strategy
Testing & Reviewing
Merge checklist