For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/components/button.md.
v0.0.57
  • English
  • Button

    General@rockshin/tao-ui

    Use 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.

    TSX

    Sizes

    Use small for dense toolbars, medium for most actions, and large for prominent calls to action.

    TSX

    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.

    TSX

    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.

    TSX

    Provider defaults

    Buttons inherit size and disabled from TaoProvider. A local prop can override the inherited size.

    TSX

    Semantic customization

    Customize the stable root part without depending on private selectors.

    TSX

    Native form actions

    Submit and reset use native form semantics; no network request is sent.

    Edit and save
    TSX

    Icon-only buttons

    Provide a name with aria-label and hide decorative icons from assistive technology.

    0 items
    TSX

    Provider defaults and overrides

    Set shared size and disabled defaults, then override a single button.

    TSX

    API

    Button

    PropertyDescriptionTypeDefault Value
    disabledPrevents interaction. Inherits from TaoProvider.boolean | undefined-
    childrenButton label or inline content.ReactNode-
    variantVisual emphasis for the action."primary" | "secondary" | "ghost" | "destructive" | "bare" | undefinedprimary
    sizeControl height and horizontal spacing. Inherits from TaoProvider.TaoSize | undefined-
    loadingShows the loading icon, sets aria-busy, and prevents interaction.boolean | undefined-
    iconLeft-leading decorative icon (non-loading state).ReactNode-
    loadingIconIcon shown while loading. Defaults to a built-in spinner.ReactNode-
    classNamesSemantic class overrides keyed by ButtonSemanticPart.Partial<Record<"root", string>> | undefined-
    stylesSemantic style overrides keyed by ButtonSemanticPart.Partial<Record<"root", CSSProperties>> | undefined-