Buttons
ButtonControlRun actions, submit forms and open dropdowns with one native button.
Overview
ButtonControl is a Blazor button: users click it to run an action, submit a form or open a dropdown panel. It renders a native <button>, so Tab, Enter and Space behave as the browser intends and ButtonType="submit" sends its form. Set the look with a btn-* class, an IconCss icon and the --fx-btn-* color variables; SaveButtonControl, CancelButtonControl and the pill-shaped RoundedButtonControl build on it.
Examples
#Actions on a leave request
Review the leave request: the actions pair a btn-* color with an IconCss icon (Team calendar puts its arrow after the caption), and Disabled follows the request's status, so only the actions that make sense stay live. Print is icon-only, named with aria-label; Small buttons adds btn-sm.
Last action: none yet
#Submit, busy and cancel
Add a colleague to cover the leave: type a name and press Enter or Save. ButtonType="submit" sends the form, and IsSaving disables the button and reads "Saving…" until the save returns. The spinner it shows meanwhile is this page's CSS in place of the library's pulse: the page turns off the animation on .fx-save-button--saving, hides the disk icon and draws a turning ring in ::before. Cancel clears the box. The colleagues covering are RoundedButtonControl pills: click one to remove it.
#Dropdown button
Click Export leave report: DropDownContent opens beneath the button, a click away closes it, and a pick calls CloseDropDown().