Prodular UI

Actions

Button

Triggers an action. Eight variants, including an AI variant for actions that run a model.

npx prodular-ui add button

Variants

One primary button per view. Secondary and outline for everything else.

AI

For actions that call a model. The animated gradient tells people the result is generated.

Sizes

With icons

Mark the icon with data-icon so the padding balances.

Loading

The label stays in place, so the button keeps its width.

Anatomy

<Button variant="outline" size="sm">  <DownloadIcon data-icon="inline-start" />  Export</Button>

Guidance

Use it when

  • Use default for the single most important action in a view.
  • Use ai when pressing the button runs a model and the output is generated, not retrieved.
  • Use destructive only for the final confirmation of an irreversible action.

Avoid

  • Two default buttons side by side. Make one of them outline or secondary.
  • The ai variant for ordinary actions that only mention AI in the label.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Label buttons with a verb and an object: Save changes, Export CSV. Never OK or Submit alone.
  • Pass loading while a request is pending instead of swapping in a spinner yourself.
  • Icon-only buttons need aria-label.

API

Button

PropTypeDefaultDescription
variant"default" | "secondary" | "outline" | "ghost" | "destructive" | "destructive-subtle" | "ai" | "link""default"Visual style.
size"xs" | "sm" | "default" | "lg" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg""default"Height and padding. Icon sizes are square.
loadingbooleanfalseShows a spinner, sets aria-busy and blocks clicks.
renderReactElementRenders the button as another element, for example a link.