havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
481 stars 67 forks source link

Toggle buttons #887

Open hakenr opened 1 day ago

hakenr commented 1 day ago

There is a Bootstrap feature we haven't covered: https://getbootstrap.com/docs/5.3/forms/checks-radios/#toggle-buttons
There is a pull request #879 from @mmonteagudo that proposes an implementation.

There are still questions to resolve:

  1. How does this coexist with Switches, which we implemented using the widely-used HxSwitch component (derived from HxCheckbox)? Should the toggle-button be another derivative of HxCheckbox, or are checkbox/switch/toggle-button variants of the basic HxCheckbox component that should be selectable via a Variant=CheckboxVariant.Regular|Switch|ToggleButton parameter? The enum-based variant would likely allow us to configure HxCheckboxList to handle rendering with a single parameter.

  2. How do we handle the optional button group?

  3. There are also Button plugin on/off buttons with similar behavior. Should we consider these as a separate feature that doesn't affect our check/radio boxes implementation, or is there potential overlap (e.g., HxCheckboxVariant.ButtonPlugin)?

crdo commented 14 hours ago

@hakenr it actually is there, but the implementation or use is somehow awkward as it requires use of pure Blazor InputCheckbox with HxButtonGroup.

It is also well hidden in the docs.

https://havit.blazor.eu/components/HxButtonGroup#checkboxes-and-radios