ActionServer-safe

Button API

Button renders a native button and maps Foundry props to stable data attributes for styling.

Preview

Import

import { Button } from "@axonyx/react";

Props

PropTypeDefaultDescription
variant"default" | "primary" | "ghost" | "accent" | "outline""default"Controls action emphasis.
surface"default" | "forged" | "brushed" | "inset""default"Applies a Foundry surface treatment.
border"forged"undefinedAdds reinforced/riveted border styling.
size"sm" | "md" | "lg""md"Controls button sizing for compact or prominent actions.
loadingbooleanfalseShows a built-in spinner and disables interaction while busy.
startIconReactNodeundefinedRenders a leading icon with built-in spacing.
endIconReactNodeundefinedRenders a trailing icon with built-in spacing.
disabledbooleanfalseUses 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.