Button
Actions

Button

Primary interactive control with five variants, two sizes, icon slots, and fullWidth.

Props

Button extends ButtonHTMLAttributes<HTMLButtonElement>. Every standard button attribute (type, form, autoFocus, …) forwards.

ButtonProps props
PropTypeDefaultDescription
variantButtonVariant"default""default" | "primary" | "outline" | "ghost" | "danger"
sizeButtonSize"md""sm" | "md"
leftIconReactNode—Slot before the label text.
rightIconReactNode—Slot after the label text.
fullWidthboolean—Stretches the button to fill its container.
loadingboolean—Replaces the leading icon with a Spinner and disables the button. The label remains visible.
disabledboolean—Prevents interaction and applies disabled styling.
onClick() => void—Click handler.
childrenReactNode—Button label.

Examples

Variants

Button variants

Sizes

Button sizes

With icons

Button with icons

Full width

Full-width button

States

Disabled states
ImportTSX
import { Button } from "@solarius/onset";
import type { ButtonVariant, ButtonSize } from "@solarius/onset";