ActionServer-safe
Button API
Button renders a native button and maps Foundry props to stable data attributes for styling.
Preview components
Open the component docs to see examples, combinations, and usage patterns built on top of this API.
- ButtonVariants, surfaces, forged borders, and action groups.
- LinkButton / IconButton / ButtonGroupRelated action primitives in the same component family.
Preview
Import
import { Button } from "@axonyx/react";Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "primary" | "ghost" | "accent" | "outline" | "default" | Controls action emphasis. |
| surface | "default" | "forged" | "brushed" | "inset" | "default" | Applies a Foundry surface treatment. |
| border | "forged" | undefined | Adds reinforced/riveted border styling. |
| size | "sm" | "md" | "lg" | "md" | Controls button sizing for compact or prominent actions. |
| loading | boolean | false | Shows a built-in spinner and disables interaction while busy. |
| startIcon | ReactNode | undefined | Renders a leading icon with built-in spacing. |
| endIcon | ReactNode | undefined | Renders a trailing icon with built-in spacing. |
| disabled | boolean | false | Uses native disabled button behavior. |
CSS contract
.ax-button .ax-button__label .ax-button__icon .ax-button__spinner [data-variant] [data-surface] [data-border] [data-size] [data-loading] [data-icon-only]
Foundry notes
Use rivets intentionally
`border="forged"` should feel like a primary Foundry signature, not decoration on every action.