AppButton

A versatile button component with multiple variants, sizes, and states.

Install: pnpm add-component AppButton

Variants

Different styles for different contexts.

Sizes

From extra small to large.

States

Loading and disabled states.

Saving, then saved

loading, then success: the label, the spinner and the check cross-fade through AppSwap instead of snapping. The check and successLabel show for 1.2s and are announced, then the label comes back.

Hold to confirm

For a destructive action: a click does nothing, holding the button (pointer, Space or Enter) fills it, and @click fires when it is full. Let go early and it drains. Screen readers hear "Press and hold for 1.5 seconds to confirm"; with reduced motion the seconds are counted instead of the fill.

Icons & tooltips

Enhanced buttons with visual cues and hover information.

On glass

The glass prop sits the button on a refracting pane, and the variant drives it: its colour moves down into the glass, where one value tints the fill, the lit rim and the glow beneath. A danger button reads as danger from the edge in. All the variant gives up is its opaque background, which would bury the backdrop the effect is made of; ghost, outline and surface stay plain glass. Sizes, icons, loading, disabled, tooltips and the focus ring are untouched. glassTone turns the colour off without flattening the weight, and glassBlur is independent of the refraction. Pulls in AppLiquidGlass.

API