You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feat]: Update <pf-v6-code-block> for PatternFly v6 #3002
Update `` to implement the PatternFly v6 Code block component.
Read-only formatted code display with optional copy-to-clipboard and expandable content.
Prior Art
Source
Element
Status
PFE v4
``
Exists
cem
--
--
cockpit
--
--
chickadee
--
--
Requirements
MUST implement PFv6 visual designs
MUST provide end-user feature parity with `@patternfly/react-core` CodeBlock
MAY adjust element API to leverage web platform strengths
SHOULD maintain CSS custom property theming compatibility
SHOULD expose useful CSS shadow parts
Element-specific considerations
React sub-components: `CodeBlockCode` (the `` content), `CodeBlockAction` (toolbar buttons) - use named slots or default slot for code, `slot="actions"` for toolbar
Copy button uses `navigator.clipboard` API (HTTPS or localhost only) - handle graceful degradation
No syntax highlighting built in; content is plain `
` - do NOT add a syntax highlighter dependency
React `expandable` variant is actually `ClipboardCopy` with `variant="expansion"`; verify `CodeBlock` v6 scope
`
` whitespace handling: preserve whitespace in slotted code content
Checklist
Rename
Delete `elements/pf-v5-code-block/`
Update `elements/package.json` exports
Update `eslint.config.js` ignore globs if applicable
Update docs `_snippets/` and `framework-integration/` references
Implementation
API per `.claude/ADVICE.md`
CSS uses v6 tokens, logical properties, nesting
`@summary` and JSDoc on element class
Demos
Demos match patternfly.org naming/structure
CSS custom properties match computed styles from patternfly.org (Chrome MCP)
Visual parity verified via Chrome MCP
Tests
Public API covered (attributes, properties, events, slots)
Activity