Button

Interactive elements for user actions

InputsStable

Preview

Interactive preview of the Button component with different variants.

Installation

Install the package via npm:

bash
npm install apex-design-system

Import

tsx
import { Button } from 'apex-design-system';

Basic Usage

tsx
<Button>Click me</Button>

Variants

The component supports multiple visual variants:

tsx
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="danger">Danger</Button>

Sizes

tsx
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>

Loading State

tsx
<Button isLoading>Loading...</Button>

With Icons

tsx
import { ArrowRight, Download } from 'lucide-react';

<Button leftIcon={<Download />}>Download</Button>
<Button rightIcon={<ArrowRight />}>Continue</Button>

Accessibility

This component follows WAI-ARIA best practices and is WCAG 2.1 AA compliant. It includes proper keyboard navigation, focus management, and screen reader support.

View in StorybookView source