Button

Buttons trigger actions. Use the primary style for the main action, others for lower-emphasis actions.

Examples

Variants

Sizes

With icons

Loading

Disabled

Icon only

Rounded

Overview

Button is the primary interactive element for triggering actions. It supports multiple variants for different emphasis levels, five sizes, icons, loading states, and accessibility features out of the box.

tsx
import { Button } from "@rogo-technologies/ui/button";

<Button variant="brand" size="md">
  Click me
</Button>;

Usage

Variants

VariantPurpose
brandPrimary actions — the main call to action on a page or section.
outlineSecondary actions — bordered style with subtle background.
mutedSecondary actions — subtle filled background, lower emphasis than outline.
ghostTertiary actions — transparent background, appears on hover.
destructiveDangerous actions — delete, remove, or irreversible operations.
textMinimal styling — inline actions without visual weight.
linkLink-style — underlines on hover, for navigation-like actions.
tsx
<Button variant="brand">Save changes</Button>
<Button variant="outline">Cancel</Button>
<Button variant="muted">Edit</Button>
<Button variant="ghost">More options</Button>
<Button variant="destructive">Delete</Button>
<Button variant="text">Learn more</Button>
<Button variant="link">View documentation</Button>

Sizes

SizeHeightUse case
xxs20pxCompact UI, tags, tight spaces
xs24pxSecondary actions in dense layouts
sm28pxToolbars, inline actions
md32pxDefault — most buttons in the interface
lg36pxPrimary CTAs, hero sections
tsx
<Button size="xxs">Tag</Button>
<Button size="md">Submit</Button>
<Button size="lg">Get started</Button>

With icons

Use prefix for an icon before the label or suffix for one after. Icons automatically scale to match the button size.

tsx
import { IconPlus, IconArrowRight } from "@rogo-technologies/ui/icons";

<Button prefix={<IconPlus />}>Add item</Button>
<Button suffix={<IconArrowRight />}>Continue</Button>
<Button prefix={<IconPlus />} suffix={<IconArrowRight />}>
  Add and continue
</Button>

Loading

When loading is true, a spinner replaces the prefix icon, the button becomes disabled, and aria-busy is set. Width stays stable to prevent layout shift.

tsx
const [isLoading, setIsLoading] = useState(false);

async function handleSubmit() {
  setIsLoading(true);
  await saveData();
  setIsLoading(false);
}

<Button loading={isLoading} onClick={handleSubmit}>
  Save changes
</Button>;

Disabled

tsx
<Button disabled={!isFormValid}>Submit</Button>
<Button disabled={isLoading}>Save</Button>

Icon only

Always provide an aria-label for accessibility.

SizeDimensions
xxs20×20
xs24×24
sm28×28
md32×32
lg36×36
tsx
<Button iconOnly aria-label="Open settings">
  <IconSettingsGear3 />
</Button>

<Button variant="ghost" iconOnly aria-label="More options">
  <IconMoreHorizontal />
</Button>

Rounded

Pill-shaped buttons. Works with all sizes and variants.

tsx
<Button rounded>Subscribe</Button>

<Button rounded iconOnly aria-label="Add">
  <IconPlus />
</Button>

As link

Render as a different element via render — e.g. a Next.js Link for navigation.

tsx
import Link from "next/link";

<Button render={<Link href="/dashboard" />}>Go to Dashboard</Button>

<Button render={<a href="https://example.com" target="_blank" />}>
  External link
</Button>

API

PropTypeDefaultDescription
variant"brand" | "outline" | "muted" | "ghost" | "destructive" | "text" | "link""brand"Visual style of the button.
size"xxs" | "xs" | "sm" | "md" | "lg""md"Size of the button.
iconOnlybooleanfalseRenders a square button for icon-only use.
roundedbooleanfalseApplies fully rounded corners (pill shape).
prefixReactNodeElement to render before the label.
suffixReactNodeElement to render after the label.
loadingbooleanfalseShows a spinner and disables the button.
disabledbooleanfalseDisables the button.
renderReactElementRenders as a different element (e.g., Link).

The Button accepts all standard HTML button attributes.

Guidelines

Do

  • Use brand for the primary action on a page or in a modal
  • Use outline or muted for secondary actions alongside a primary button
  • Use ghost for tertiary or contextual actions (e.g., in toolbars)
  • Use destructive only for irreversible or dangerous actions
  • Provide aria-label for icon-only buttons
  • Use loading state for async operations to provide feedback
  • Keep button labels concise and action-oriented ("Save", "Delete", "Continue")

Don't

  • Don't use multiple brand buttons in the same context — there should be one clear primary action
  • Don't use destructive for non-dangerous actions just for visual emphasis
  • Don't disable buttons without explaining why (consider a tooltip or helper text)
  • Don't use icon-only buttons without aria-label — they're inaccessible to screen readers
  • Don't mix too many button variants in one area — it creates visual noise
  • Don't use text or link variants for important actions — they lack visual prominence
PreviousBadge
Made in NYC© 2026 Rogo Technologies Inc.