Button
Squircle button in three sizes and five variants. Supports left and right icons, a slide-in hover animation for right-side icons, icon-only mode, full-width layout, and a loading state. For provider sign-in buttons see Social Button, which is built on this. Works with both iconsax-react and @hugeicons/react.
Installation
npx stepwise-ui add button
Variants
With icons
Pass any icon element to icon and control placement with iconPosition.
Slide icon
slideIcon hides the icon on desktop until hover, sliding in from whichever side iconPosition names. On touch (pointer: coarse) the icon is always visible.
Icon only
iconOnly renders a square button (width = height). Always add aria-label. The same four concepts (add, mail, settings, download) are shown side-by-side from both libraries so you can compare the icon styles at a glance.
Full width
fullWidth stretches the button to 100% of its parent container. Useful for forms, cards, and mobile layouts.
Disabled
The disabled prop applies 45% opacity, flattens the elevation, and blocks all pointer events. Works across every variant and size.
Loading
The label always stays put. With an icon the spinner takes the icon's slot; without one it centres over a faded label, so the button never changes width mid-request and its accessible name survives. Sets aria-busy.
Custom fill
Defaults stay on the design tokens. Pass Tailwind on className to restyle one instance. bg-sky-500 is promoted to both gradient stops so a single colour still covers the fill. from-* / to-* replace the fade. Pair a fill change with text-* so the label contrast holds.
Sizes
Three sizes with fully-rounded corners (radius = height ÷ 2) and squircle smoothing at 0.6.
Props
PropTypeDescription
variant"solid" | "outline" | "ghost" | "soft" | "destructive"Visual style. Default: "solid".
size"sm" | "default" | "lg"28 / 36 / 40 px. Default: "default" (36 px).
iconReact.ReactNodeIcon element - iconsax-react or @hugeicons/react.
iconPosition"left" | "right"Side the icon renders on. Default: "left".
iconOnlybooleanSquare icon-only button. Requires aria-label.
slideIconbooleanIcon hides until hover, from either side. Always visible on touch.
fullWidthbooleanStretches button to 100% of the parent container.
loadingbooleanSpinner + aria-busy, disables the button. Label and width stay put.
disabledboolean45% opacity, flattens elevation, blocks interaction.
noRipplebooleanDisables the press ripple. Skipped automatically under prefers-reduced-motion.
hrefstringRenders an <a> instead of a <button>, styled identically. Ignored while disabled or loading. target="_blank" gets rel="noopener noreferrer" automatically.
classNamestringMerged last via cn(). bg-* becomes both gradient stops; from-* / to-* replace the fade; text-* / h-* / px-* override the matching defaults.