Meet Frontfriend v4.Your brand. Your rules. Your agents, connected.Explore what’s new

Button

Small detail. Big first impression. Every action, unmistakably yours.

Interactive preview

Built on Base UI. Component colors, typography and styling come from your Design System.

Installation

Complete project setup first. Your configuration must select react/base and include your Design System ID.

npx frontfriend download button -f react --primitive base --registry v4

Review dependencies reported by the downloader and keep your source changes in version control.

Usage & composition

Base UI owns the interaction mechanics. Prefer its native render composition. Frontfriend’s trigger adapters also accept the documented asChild compatibility form; do not assume every upstream Base UI primitive does.
import { Button } from '@/components/ui/button';

export function Example() {
  return (
    <Button variant="main" size="default"
      onClick={() => console.log('Let’s build')}>
      Make it happen
    </Button>
  );
}

Loading and icon-only actions

Use loading and loadingText for asynchronous feedback. Disable duplicate submission in your own action handler as well. Use a configured icon name and provide an accessible label for an icon-only button.

<Button loading={saving} loadingText="Saving…">Save changes</Button>

API reference

Frontfriend-owned props and selected target integration points. Native HTML and inherited primitive props remain documented by Base UI.

Prop / partTypeDefaultPurpose
variant main | default | outline | secondary | ghost | destructive | tertiary | ghostmain | link | linkDestructive default Visual intent, resolved from the design-system config.
size xs | sm | default | lg | icon | icon-xs | icon-sm | icon-lg default Text and icon sizing choices.
loading boolean false Show the configured loading treatment. Review duplicate-activation behavior in your app.
loadingText string Optional text shown while loading.
icon configured icon name Use an icon available in the system icon map.
iconPosition prefix | suffix | default default Prefix/suffix with text; default is the icon-only position when icon is set.
fullwidth boolean false Select the configured full-width variant.
disabled boolean false Prevent activation using the target’s native disabled behavior.
onClick event handler Handle activation with the selected target.

Configuration determines the actual classes and available styling hooks. See Theming & component configuration before introducing a repeated local override.

Accessibility

  • Use a button for actions and a link for navigation. React Aria also exposes a target-specific LinkButton.
  • Give icon-only controls an accessible name.
  • Preserve a visible keyboard focus indicator and communicate asynchronous status.
  • Disabled and loading behavior must prevent unintended repeated actions.