Add new Icon parameter to BitToggleButton (#12022)#12038
Add new Icon parameter to BitToggleButton (#12022)#12038msynk merged 1 commit intobitfoundation:developfrom
Conversation
WalkthroughThis PR introduces external icon library support to the BitToggleButton component by adding new public parameters (Icon, OffIcon, OnIcon) that accept BitIconInfo objects, with fallback logic to existing icon name properties. Demo pages are updated to showcase FontAwesome integration. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ToggleButton/BitToggleButtonDemo.razor`:
- Around line 289-319: The demo mixes raw string implicit-conversion for the
Icon parameter with uses of BitIconInfo helpers; update the first
BitToggleButton so its Icon uses BitIconInfo.Css("fa-solid fa-microphone") (same
style as the other examples) to keep consistency across BitToggleButton usages
and make the intent explicit; ensure you reference the Icon parameter on
BitToggleButton and use BitIconInfo.Css (or BitIconInfo.Fa where appropriate)
for external icons throughout this DemoExample.
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ToggleButton/BitToggleButtonDemo.razor.samples.cs`:
- Around line 196-211: Replace the raw string icon usages with the BitIconInfo
helpers to match existing examples: change the BitToggleButton using
Icon="@("fa-solid fa-microphone")" to use BitIconInfo.Css("fa-solid
fa-microphone"), and update any occurrences where BitIconInfo.Fa(...) and
BitIconInfo.Css(...) are inconsistently mixed (e.g., the first Icon and any
other plain-string icons) so all icons in the snippet use BitIconInfo.Css(...)
or BitIconInfo.Fa(...) consistently with the other BitToggleButton examples.


closes #12022
Summary by CodeRabbit