Figma Button
Custom button component based on Figma design system. Features primary, secondary, and tertiary variants with exact color matching.
Live Preview
Button • Interactive Explorer
Explore all button variants with live preview, code generation, and accessibility information
Button Type
Size
Background
Inspect Mode
Show design specs
<FigmaButton
type="primary"
size="regular"
state="default"
background="light"
onClick={handleClick}
disabled={false}
>
Primary Button
</FigmaButton>Design Tokens
Complete design token definitions for all button variants. Export and integrate these tokens into your design system.
{
"primary": {
"light": {
"default": {
"background": "#C94F1A",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#D76F33",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#D76F33",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"outline": "2px solid #141217",
"outlineOffset": "2px"
},
"disabled": {
"background": "#EAEAEA",
"text": "#858585",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"cursor": "not-allowed"
}
},
"dark": {
"default": {
"background": "#C94F1A",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#D76F33",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#D76F33",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"outline": "2px solid #FFFFFF",
"outlineOffset": "2px"
},
"disabled": {
"background": "#4A4A4A",
"text": "#808080",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"cursor": "not-allowed"
}
}
},
"secondary": {
"light": {
"default": {
"background": "transparent",
"text": "#141217",
"border": "1px solid #828488",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#F2F2F2",
"text": "#141217",
"border": "1px solid #828488",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#F2F2F2",
"text": "#141217",
"border": "1px solid #141217",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"outline": "2px solid #141217",
"outlineOffset": "2px"
},
"disabled": {
"background": "#E5E5E5",
"text": "#858585",
"border": "1px solid #969696",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"cursor": "not-allowed"
}
},
"dark": {
"default": {
"background": "transparent",
"text": "#FFFFFF",
"border": "1px solid #666666",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#333333",
"text": "#FFFFFF",
"border": "1px solid #666666",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#333333",
"text": "#FFFFFF",
"border": "1px solid #FFFFFF",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"outline": "2px solid #FFFFFF",
"outlineOffset": "2px"
},
"disabled": {
"background": "#2A2A2A",
"text": "#555555",
"border": "1px solid #444444",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"cursor": "not-allowed"
}
}
},
"tertiary": {
"light": {
"default": {
"background": "transparent",
"text": "#C34400",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#F2F2F2",
"text": "#C34400",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#F2F2F2",
"text": "#C34400",
"border": "1px solid #141217",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"outline": "2px solid #141217",
"outlineOffset": "2px"
},
"disabled": {
"background": "transparent",
"text": "#858585",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"cursor": "not-allowed"
}
},
"dark": {
"default": {
"background": "transparent",
"text": "#FF9D6A",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#333333",
"text": "#FF9D6A",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#333333",
"text": "#FF9D6A",
"border": "1px solid #FFFFFF",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"outline": "2px solid #FFFFFF",
"outlineOffset": "2px"
},
"disabled": {
"background": "transparent",
"text": "#555555",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px",
"cursor": "not-allowed"
}
}
},
"sizes": {
"small": {
"padding": "12px 6px",
"fontSize": "12px",
"height": "24px"
},
"regular": {
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px"
},
"large": {
"padding": "20px 10px",
"fontSize": "18px",
"height": "40px"
}
}
}Color Semantics & Usage
Primary action, positive emphasis
- • Save
- • Submit
- • Create
- • Confirm
Alternative action, medium emphasis
- • Cancel
- • Close
- • Skip
- • Decline
Low emphasis, helper text action
- • Learn More
- • Help
- • Additional Options
Button State Flow
Understanding how button states transition based on user interactions. States are visual feedback, not application state.
Default
Initial state, button is ready
Hover
User moves mouse over button
Focus
User tabs to button or clicks
Disabled
Button cannot be interacted with
Default
Button appears with default styling
Page load, button enabled
Yes, button responds to input
Hover
Button appears with hover styling
Mouse enters button area
Yes, button responds to input
Focus
Button appears with focus styling
Tab key or mouse down
Yes, button responds to input
Disabled
Button appears with disabled styling
disabled={true} prop
No, user cannot interact
State Rules & Behavior
Focus can appear WITH Hover
If a user tabs to a button while hovering, both hover and focus visual feedback is applied
Disabled blocks all transitions
When disabled=true, hover/focus states are ignored. Button shows disabled styling instead
Focus ring is always visible
Focus state includes a 2px ring around the button for accessibility (helps keyboard users)
Click triggers action immediately
Focus state doesn't guarantee action will trigger. User must press Enter or Space
Implementation Notes
// Button state is controlled by:
// 1. Component state (isLoading, isDisabled)
// 2. User interaction (hover, focus)
// 3. Visual state prop (default, hover, focus, disabled)
const [isDisabled, setIsDisabled] = useState(false);
const [isLoading, setIsLoading] = useState(false);
<FigmaButton
type="primary"
size="regular"
state={isDisabled ? 'disabled' : 'default'}
disabled={isDisabled}
onClick={handleClick}
>
{isLoading ? 'Loading...' : 'Save Changes'}
</FigmaButton>
// CSS handles state transitions automatically:
// :hover → hover state
// :focus-visible → focus state
// :disabled → disabled stateKeyboard Navigation Demo
Test keyboard accessibility. Use Tab to navigate, Enter/Space to activate, Escape to unfocus.
Keyboard Event Log
✓ What We Do Right
- • Semantic
<button>element - • Full keyboard access (Tab, Enter, Space)
- • Visible focus indicators (2px ring)
- • Focus management (Shift+Tab works)
- • ARIA attributes included
- • Screen reader compatible
⚠️ Accessibility Notes
- • Focus order: Left to right, top to bottom
- • Disabled buttons not focusable (best practice)
- • Focus ring color: High contrast (#141217)
- • Touch targets: 30px height minimum
- • Keyboard hints: Tooltip on focus
- • Screen reader: Announces button state
Keyboard Accessibility Checklist
Real-World Usage Examples
See button patterns in realistic UI contexts. These examples show best practices for sizing, type selection, and grouping.
Form Submission
Standard form with primary submit and secondary cancel buttons
Code Example
Copy this pattern to your project
<form className="space-y-4">
<input type="text" placeholder="Name" />
<textarea placeholder="Message" />
<div className="flex gap-2">
<FigmaButton type="primary" size="regular">
Submit
</FigmaButton>
<FigmaButton type="secondary" size="regular">
Cancel
</FigmaButton>
</div>
</form>Best Practices for This Example
Primary button for main action (Submit)
Secondary button for cancel/alternative
Use regular size for web forms
Group related actions horizontally
Touch Target Sizing Guide
WCAG 2.5.5 (Level AAA) recommends minimum 44x44px touch targets. Use this guide to choose the right button size for your use case.
- • Toolbars
- • Compact grids
- • Dense layouts
- • Forms
- • Cards
- • Standard interfaces
- • Mobile CTAs
- • Primary actions
- • Prominent buttons
Button Types & Semantics
Each button type serves a specific purpose. Choose based on the action's importance and context.
- Save, Submit, Create
- Confirm actions
- Primary CTAs
- Cancel, Close
- Skip, Decline
- Alternative flows
- Learn More
- Help, Options
- Additional actions
Full Variants Matrix
Complete reference of all 72 button combinations (for developers who need comprehensive documentation)
Resources
Accessibility
- ✓ WCAG 2.1 AA Compliant
- ✓ Keyboard Navigation
- ✓ Screen Reader Support
- ✓ Focus Indicators
Version
v1.0.0 - Enhanced Demo
Last updated: 2025-11-30
Variants
Code
/src/components/design-system/FigmaButton/FigmaButton.demo.tsx