AsterUIDocsv1.0.2

Docs / Component reference

Button & ButtonGroup

Use a button for an action and a button group for related actions. The example keeps its count in the caller.

Button example

Install

sh
npx @fierst/ui@1.0.2 add button

Registry dependencies: theme, icon. Package dependencies: @lucide/icons.

Exports from ./ui/button: ButtonVariant, ButtonSize, ButtonProps, Button, ButtonGroup.

Download the registry source for button 1.0.2.

API contracts

ts
export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link';

export type ButtonSize = 'sm' | 'md' | 'lg' | 'icon';

export interface ButtonProps {
  variant?: ButtonVariant;
  size?: ButtonSize;
  loading?: boolean;
  disabled?: boolean;
  type?: 'button' | 'submit' | 'reset';
  class?: string;
  children?: View;
  [key: string]: any;
}

export function Button({
  variant = 'outline',
  size = 'md',
  loading = false,
  disabled = false,
  type = 'button',
  class: extraClass,
  children,
  ...rest
}: ButtonProps)

export function ButtonGroup(props: { class?: string; children?: View; label?: string })