Skip to content

feat(card)!: add <pf-v6-card> - #3167

Draft
zeroedin wants to merge 1 commit into
staging/pfv6from
feat/v6-card
Draft

zeroedin wants to merge 1 commit into
staging/pfv6from
feat/v6-card

Conversation

@zeroedin

Copy link
Copy Markdown
Collaborator

Summary

  • Ports <pf-v5-card> to <pf-v6-card> and removes pf-v5-card
  • Composition via slots (header, title, subtitle, actions, footer, expandable-content) plus one pf-v6-card-body sub-element
  • Supports variant="secondary", size="compact|large", plain, glass, and full-height
  • Selectable cards are form-associated (FACE): selected submits value (default on) under name and resets with the form
  • selection="single" groups radios across shadow roots with roving tabindex and Arrow/Home/End
  • Actionable cards render an <a> (href/target) or a shadow <button>; combinable with selectable
  • Expandable cards own expanded state; expand, collapse, and change events are cancelable
  • Accessible name falls back through accessible-label → title → header heading → header image alt
  • All CSS uses --pf-v6-c-card--* design tokens
  • 23 demos, 47 unit tests

Closes #2986

Intentional divergences from React

  • React sub-components (CardHeader, CardTitle, CardBody, …) replaced by slots and pf-v6-card-body
  • is* booleans renamed without the prefix (isSelectable → selectable, …)
  • isCompact/isLarge replaced by one exclusive size enum
  • selectableActions.variant → selection="single"; isHidden → hide-input
  • onExpand/onChange callbacks → cancelable expand/collapse/change events
  • hasNoOffset → card-level no-offset; to/isExternalLink → href/target
  • selectableActionAriaLabelledby is not supported cross-root; use accessible-label
  • component, OUIA props, innerRef, and prop spreading not implemented; slot a heading for document semantics
  • Form association added (not in React)

Follow-up tasks

Test plan

  • npm run test passes
  • npm run lint and tspc -b elements pass
  • Demos render at localhost:8000 with ?rendering=chromeless
  • Visual parity with patternfly.org card demos
  • Form submission and reset work for selectable cards; change is cancelable
  • Single-selection groups expose one tab stop; Arrow/Home/End move selection
  • Actionable cards navigate via href and ignore clicks on nested interactive content
  • Expandable cards toggle via click, Enter, and Space; expand/collapse are cancelable
  • prefers-reduced-motion disables the transition
  • Dark mode colors correct when switching color scheme
  • cem health score above 80%

@zeroedin zeroedin self-assigned this Nov 11, 2026
@changeset-bot

changeset-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8eeb840

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@patternfly/elements Major

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

@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the AT passed Automated testing has passed label Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "feat(card)!: add `<pf-v6-card>`"
}

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 9757406
😎 Deploy Preview https://deploy-preview-3167--patternfly-elements.netlify.app/

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions

Copy link
Copy Markdown
Contributor

SSR Test Run for 9757406: Report

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AT passed Automated testing has passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant