An exploration of a high-performance Indigo button system. This experiment showcases a complete variant matrix, interactive state management, and full WCAG accessibility compliance documentation.
Explore all button variants with live preview, code generation, and accessibility information
Inspect Mode
Show design specs
<ExperimentButton
type="primary"
size="regular"
state="default"
background="light"
onClick={handleClick}
disabled={false}
>
Primary Button
</ExperimentButton>Complete design token definitions for all button variants. Export and integrate these tokens into your design system.
{
"primary": {
"light": {
"default": {
"background": "#4F46E5",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#6366F1",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#6366F1",
"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": "#4F46E5",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#6366F1",
"text": "#FFFFFF",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#6366F1",
"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": "#4338CA",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#F2F2F2",
"text": "#4338CA",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#F2F2F2",
"text": "#4338CA",
"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": "#818CF8",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"hover": {
"background": "#333333",
"text": "#818CF8",
"border": "none",
"padding": "16px 8px",
"fontSize": "14px",
"height": "30px",
"borderRadius": "2px"
},
"focus": {
"background": "#333333",
"text": "#818CF8",
"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"
}
}
}Primary action, positive emphasis
Alternative action, medium emphasis
Low emphasis, helper text action
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
Button appears with default styling
Page load, button enabled
Yes, button responds to input
Button appears with hover styling
Mouse enters button area
Yes, button responds to input
Button appears with focus styling
Tab key or mouse down
Yes, button responds to input
Button appears with disabled styling
disabled={true} prop
No, user cannot interact
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
// 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);
<ExperimentButton
type="primary"
size="regular"
state={isDisabled ? 'disabled' : 'default'}
disabled={isDisabled}
onClick={handleClick}
>
{isLoading ? 'Loading...' : 'Save Changes'}
</ExperimentButton>
// CSS handles state transitions automatically:
// :hover → hover state
// :focus-visible → focus state
// :disabled → disabled stateTest keyboard accessibility. Use Tab to navigate, Enter/Space to activate, Escape to unfocus.
<button> elementSee button patterns in realistic UI contexts. These examples show best practices for sizing, type selection, and grouping.
Standard form with primary submit and secondary cancel buttons
Copy this pattern to your project
<form className="space-y-4">
<input type="text" placeholder="Name" />
<textarea placeholder="Message" />
<div className="flex gap-2">
<ExperimentButton type="primary" size="regular">
Submit
</ExperimentButton>
<ExperimentButton type="secondary" size="regular">
Cancel
</ExperimentButton>
</div>
</form>Primary button for main action (Submit)
Secondary button for cancel/alternative
Use regular size for web forms
Group related actions horizontally
WCAG 2.5.5 (Level AAA) recommends minimum 44x44px touch targets. Use this guide to choose the right button size for your use case.
Each button type serves a specific purpose. Choose based on the action's importance and context.
Complete reference of all 72 button combinations (for developers who need comprehensive documentation)
v1.0.0 - Enhanced Demo
Last updated: 2025-11-30