Skip to content

feat(Menu toggle): Added support for a adding styling for a menu toggle in a form#12326

Open
tlabaj wants to merge 1 commit intopatternfly:mainfrom
tlabaj:menu_toggle
Open

feat(Menu toggle): Added support for a adding styling for a menu toggle in a form#12326
tlabaj wants to merge 1 commit intopatternfly:mainfrom
tlabaj:menu_toggle

Conversation

@tlabaj
Copy link
Copy Markdown
Contributor

@tlabaj tlabaj commented Apr 7, 2026

What: Closes #12279, #12325

  • Added beta boolean prop isInForm (default false). When true, the root toggle element gets the pf-m-form modifier.
  • Added test to isInForm
  • made change to no use hard coded pf-m-text
  • Added a test for when variant="plainText that asserts the toggle has pf-m-plain and pf-m-text modifiers.

Summary by CodeRabbit

  • New Features
    • MenuToggle component now includes a new beta property that provides additional styling flexibility and customization options for different use scenarios
    • CSS class handling for the plainText variant has been improved to ensure more consistent and reliable visual appearance across various implementations

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2cac7b42-1a3e-4c2e-858a-6bde8b8ffc6f

📥 Commits

Reviewing files that changed from the base of the PR and between 911223a and 79fe190.

📒 Files selected for processing (2)
  • packages/react-core/src/components/MenuToggle/MenuToggle.tsx
  • packages/react-core/src/components/MenuToggle/__tests__/MenuToggle.test.tsx

Walkthrough

Added a new @beta isInForm boolean prop to the MenuToggle component that conditionally applies a form styling CSS class. Updated variant='plainText' to reference CSS classes instead of string literals. Added corresponding test coverage.

Changes

Cohort / File(s) Summary
MenuToggle Component
packages/react-core/src/components/MenuToggle/MenuToggle.tsx
Added optional isInForm beta prop (defaults to false) that conditionally applies styles.modifiers.form class. Changed variant='plainText' to use styles.modifiers.text CSS class reference instead of raw string literal.
MenuToggle Tests
packages/react-core/src/components/MenuToggle/__tests__/MenuToggle.test.tsx
Added three new assertion tests: one verifying plainText variant includes styles.modifiers.text class, and two verifying isInForm prop correctly applies/omits styles.modifiers.form class.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an isInForm prop to enable form-specific styling for MenuToggle components.
Linked Issues check ✅ Passed The PR successfully implements the objective from issue #12279 by adding the requested isInForm prop to style menu toggles correctly when used inside forms.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objective: the new isInForm prop, conditional form styling, and test coverage for the new functionality with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@tlabaj tlabaj marked this pull request as ready for review April 7, 2026 20:24
@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented Apr 7, 2026

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MenuToggle - Unified theme updates

2 participants