- Primary
- Secondary
- Ghost
Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aurelienbobenrieth/gadget/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheButton component provides a styled, accessible button with support for multiple visual variants and sizes. Built with class-variance-authority (CVA) for type-safe variant handling.
Import
Basic Usage
Variants
The Button component supports three visual variants:Sizes
Three size options are available:sm- Height: 28px (7), Padding: 12px (3), Font: 12px (xs)md- Height: 32px (8), Padding: 16px (4), Font: 14px (sm) - Defaultlg- Height: 36px (9), Padding: 20px (5), Font: 14px (sm)
Props
The visual style variant of the button.
The size of the button.
Additional CSS classes to apply.
Disables the button and reduces opacity to 50%.
ButtonHTMLAttributes<HTMLButtonElement>, so all standard button attributes are supported (onClick, type, disabled, etc.).
Accessibility Features
- Focus visible outline with 2px accent color and offset
- Disabled state prevents pointer events
- Semantic
<button>element - Proper ARIA attributes inherited from native button
Examples
Disabled State
With Icon and Text
gap-1.5 to automatically space child elements.
Custom Styling
Component Definition
Location:packages/gadget-ui/src/components/button.tsx:55
The Button uses forwardRef to support ref forwarding to the underlying button element.