Skip to main content
Version: 1.0.3

Button

This documentation covers four types of buttons: the base Button, Button With Spinner, Button With Icon, and Button Group.

Button Variant

Buttons allow users to take actions with a single tap. They can be customized with different styles, sizes, and animations.

Installation

ignix add component button

Usage

Import the component:

import { Button } from './components/ui';

Basic Usage

function BasicButton() {
return (
<Button>Click me</Button>
);
}

Props

PropTypeDefaultDescription
variant'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'outline' | 'ghost' | 'link' | 'subtle' | 'elevated' | 'glass' | 'neon' | 'pill' | 'none''default'The visual style variant of the button
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'icon' | 'pill' | 'block' | 'compact' | 'wide''md'The size of the button
asChildbooleanfalseWhen true, merges props with the child component instead of rendering a button element
animationVariantstringundefinedAnimation variant to apply to the button (e.g., 'bounce', 'pulse', 'spin', etc.)
childrenReact.ReactNode-The button content/text
classNamestring-Additional CSS classes to apply
disabledbooleanfalseWhether the button is disabled
onClick(event: React.MouseEvent<HTMLButtonElement>) => void-Click event handler
All standard button HTML attributes--All standard HTML button attributes are supported