Button
@rockshin/tao-uiUse Button for immediate actions such as submitting a form, saving changes, or opening a surface.
Examples
Variants
Use one primary action per view or decision area. Secondary, ghost, and destructive variants reduce or clarify emphasis. Bare preserves button behavior while leaving its visual treatment to consumer classes or styles.
Sizes
Use small for dense toolbars, medium for most actions, and large for prominent calls to action.
Loading and disabled
Loading buttons set aria-busy and prevent repeated interaction. Their icon slot stays mounted, so switching states does not shift the content.
Icons and custom loading
Pass a decorative leading icon with icon. Explicit SVG dimensions are preserved; unspecified dimensions default to the button's font size. Use loadingIcon only when the built-in spinner does not match the surrounding visual language.
Provider defaults
Buttons inherit size and disabled from TaoProvider. A local prop can override the inherited size.
Semantic customization
Customize the stable root part without depending on private selectors.
Native form actions
Submit and reset use native form semantics; no network request is sent.
Icon-only buttons
Provide a name with aria-label and hide decorative icons from assistive technology.
Provider defaults and overrides
Set shared size and disabled defaults, then override a single button.