ui-kit0.0

Actions

Button

Actions with press feedback and a loading state.

Variants

One primary action per surface. Secondary, outline and ghost carry less weight; soft tints with the accent; destructive is for actions that delete or can’t be undone.

When to use

  • Any single action on a page, form or dialog: Save, Continue, Cancel.
  • Short async work where a spinner on the button is enough feedback — use loading.
  • Navigation that should look like an action — wrap a link with asChild.

Not for: plain navigation inside text (use a link), on/off settings (use a switch), choosing one of a few views (use a segmented control).

Sizes

28, 32, 36 and 44px tall. Use lg for the main call to action on touch screens.

With icons

Put an Icon before or after the label. Icon-only buttons use icon and always need an aria-label.

Loading and disabled

loading shows a spinner, keeps the width and swallows clicks. It uses aria-busy instead of disabled, so keyboard focus is not lost mid-action. Click the first button.

As a link

asChild renders your element (here a Next.js Link) with the button’s styles and behaviour.

Button group

API

Button

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'outline' | 'ghost' | 'soft' | 'destructive' | 'link''primary'Visual weight.
size'xs' | 'sm' | 'md' | 'lg''md'Height and padding: 28 / 32 / 36 / 44px.
iconbooleanfalseSquare icon-only button. Needs aria-label.
loadingbooleanfalseSpinner, aria-busy, clicks ignored, focus and width kept.
asChildbooleanfalseRender the child element with button styles.
...propsButtonHTMLAttributes—Forwarded to <button>, including ref, type, disabled, onClick.

Need the classes on something else? buttonClassName({ variant, size }) returns them. In plain HTML: ui-btn ui-btn-outline ui-btn-sm.

Keyboard

KeyAction
EnterActivates the button.
SpaceActivates the button.

Accessibility

  • Renders a native <button>, so role, focus and keyboard come for free.
  • Loading uses aria-busy + aria-disabled instead of disabled, keeping focus in place.
  • Keyboard focus shows a 3px ring; pointer focus does not.

Motion

  • Press scales to .97 on the snappy spring (icon buttons .94). Buttons that open a popup answer with colour only.
  • Hover tints apply only on devices with a fine pointer, so taps never leave a stuck hover.
  • Reduced motion: no press scale; colours still change.