[**@fungi.computer/caps**](../README.md) --- [@fungi.computer/caps](../README.md) / components/button # components/button ## Type Aliases ### ButtonVariant ```ts type ButtonVariant = | "primary" | "secondary" | "accent" | "destructive" | "outline" | "ghost" | "ghost-destructive" | "link"; ``` Supported Button visual variants. --- ### ButtonSize ```ts type ButtonSize = "xs" | "sm" | "default" | "lg" | "icon" | "menubar"; ``` Supported ButtonSize values. --- ### ButtonResult ```ts type ButtonResult = "done" | "failed"; ``` The outcome of a Button's last action. --- ### ButtonProps ```ts type ButtonProps = object & ButtonHTMLAttributes; ``` Props accepted by Button. #### Type Declaration | Name | Type | Description | | ---------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `asChild?` | `boolean` | - | | `loading?` | `boolean` | - | | `result?` | [`ButtonResult`](#buttonresult) | The outcome of the last action. Becoming `done` plays a short beat: a check (and `resultLabel`) springs in, holds, then settles back to the label. Becoming `failed` shakes the label by the theme's `--stipe-motion-shake`. Say what failed elsewhere, next to the action. | | `resultLabel?` | `ReactNode` | What the done beat says, such as "Installed". The button keeps the wider of its two labels, so nothing shifts. | | `onResultEnd()?` | () => `void` | Called when the done beat has held long enough to read, just before it would settle back to the label. Replace the button here to hand off to what comes next (an "Installed" mark, an "Open" action). | | `size?` | [`ButtonSize`](#buttonsize) | - | | `variant?` | [`ButtonVariant`](#buttonvariant) | - | --- ### ButtonElement ```ts type ButtonElement = ElementRef<"button">; ``` The native element type used by Button. ## Variables ### Button ```ts const Button: ForwardRefExoticComponent< object & ButtonHTMLAttributes & RefAttributes >; ``` A reusable button with caller-controlled native behavior and intrinsic loading presentation.