Overview
TheAxButton component provides a set of predefined visual variants for buttons across the AxMed design system. It wraps Ant Design’s Button component with custom styling and a simplified variant API.
Import
Props
Visual variant of the button. Available options:
"primary"- Primary action button with filled background"secondary"- Secondary action button with outlined style"ghost"- Transparent button with primary color border"danger"- Destructive action button in red"link"- Button styled as a text link"text"- Button with no border or background
Button content (text, icons, or other elements)
Whether the button is disabled
Show loading spinner and disable the button
Icon element to display before button text
Position of the icon relative to button text
Whether button should take full width of its container
HTML button type attribute
Click event handler
Additional CSS classes to apply
Inline styles to apply
Type Definitions
ButtonProps while omitting conflicting props (type, danger, ghost, variant) that are mapped through the variant prop.
Usage Examples
Basic Variants
With Icons
Loading State
Full Width
Disabled State
Related Components
- AxActionMenu - For dropdown menus with actions
- AxModal - Buttons are commonly used in modal footers
- AxDrawer - Buttons are commonly used in drawer footers