ButtonProps Interface
Props
variant
Visual style variant of the button.
primary: Main action button with primary brand colorsecondary: Secondary action button with muted colordanger: Destructive action button with danger color
size
Size of the button affecting padding and font size.
small: Compact button (min-height: 2rem)medium: Standard button (min-height: 2.5rem)large: Prominent button (min-height: 3rem)
disabled
Disables the button, preventing interaction and reducing opacity.
children
Content to be rendered inside the button. Can be text, icons, or other React elements.
type
HTML button type attribute.
button: Standard buttonsubmit: Form submission buttonreset: Form reset button
onClick
Click event handler function.
className
Additional CSS classes to apply to the button.
aria-label
Accessible label for screen readers. Required for icon-only buttons.
aria-describedby
ID of element that describes the button.
Inherited Props
Button extendsReact.ButtonHTMLAttributes<HTMLButtonElement>, inheriting all standard HTML button attributes:
idnamevalueformformActionformMethodformTargetformNoValidateautoFocusonFocusonBluronMouseEnteronMouseLeave- And all other standard button attributes
CSS Classes
| Class | Description |
|---|---|
.btn | Base button class |
.btn--primary | Primary variant |
.btn--secondary | Secondary variant |
.btn--danger | Danger variant |
.btn--small | Small size |
.btn--medium | Medium size |
.btn--large | Large size |
CSS Variables
| Variable | Default | Description |
|---|---|---|
--primary-color | #007bff | Primary button background |
--primary-hover | #0056b3 | Primary button hover state |
--secondary-color | #6c757d | Secondary button background |
--danger-color | #dc3545 | Danger button background |
--font-family | System fonts | Button font family |
--border-radius | 0.375rem | Button border radius |
--transition-base | all 0.2s ease-in-out | Button transitions |