Context
Followup to patternfly/patternfly#8326 which added a fill modifier to the ToggleGroup component in patternfly core.
Changes in patternfly core
- Added
.pf-m-fill modifier to make toggle group items fill available space
- Items use
display: flex; flex-grow: 1 and buttons use flex-basis: 100%; justify-content: center
- Added "Full width toggle" example with 3 variations (basic, multi-select, with disabled item)
- Updated documentation table with the new modifier
Work needed in patternfly-react
1. Add isFill prop to ToggleGroup component
File: packages/react-core/src/components/ToggleGroup/ToggleGroup.tsx:12
- Add new prop to
ToggleGroupProps interface after isCompact
- Type:
boolean with default false
- Description: "Modifies the toggle group items to fill the available space."
2. Apply fill modifier class
File: packages/react-core/src/components/ToggleGroup/ToggleGroup.tsx:35
- Update
className in the component render to include isFill && styles.modifiers.fill
3. Add full width toggle example
Files:
-
packages/react-core/src/components/ToggleGroup/examples/ToggleGroupFill.tsx (new file)
-
packages/react-core/src/components/ToggleGroup/examples/ToggleGroup.md (update around line 62)
-
Create new example demonstrating the fill modifier
-
Add example section after "Compact toggle group"
-
Include variations matching patternfly core examples:
- Basic fill toggle group
- Fill toggle group with multi-select
- Fill toggle group with disabled item
🤖 Generated with Claude Code
Jira Issue: PF-4041
Context
Followup to patternfly/patternfly#8326 which added a fill modifier to the ToggleGroup component in patternfly core.
Changes in patternfly core
.pf-m-fillmodifier to make toggle group items fill available spacedisplay: flex; flex-grow: 1and buttons useflex-basis: 100%; justify-content: centerWork needed in patternfly-react
1. Add
isFillprop to ToggleGroup componentFile:
packages/react-core/src/components/ToggleGroup/ToggleGroup.tsx:12ToggleGroupPropsinterface afterisCompactbooleanwith defaultfalse2. Apply fill modifier class
File:
packages/react-core/src/components/ToggleGroup/ToggleGroup.tsx:35classNamein the component render to includeisFill && styles.modifiers.fill3. Add full width toggle example
Files:
packages/react-core/src/components/ToggleGroup/examples/ToggleGroupFill.tsx(new file)packages/react-core/src/components/ToggleGroup/examples/ToggleGroup.md(update around line 62)Create new example demonstrating the fill modifier
Add example section after "Compact toggle group"
Include variations matching patternfly core examples:
🤖 Generated with Claude Code
Jira Issue: PF-4041