Button
Buttons trigger actions and guide users through key interactions on your website. Use them for form submissions, navigation, downloads, and other important user actions. The button component supports multiple styles, sizes, states, and can include icons to enhance usability and visual hierarchy.
Do
- Use clear, action-oriented text that describes what will happen when clicked (e.g., "Submit Application", "Download PDF").
- Choose appropriate button styles based on importance: primary for main actions, secondary for supporting actions, tertiary for low-priority supplementary actions.
- Provide sufficient contrast between button text and background colors for accessibility.
- Use consistent button placement throughout your site to build user expectations.
- Include icons when they add clarity to the button's purpose (download, external link, etc.).
- Test with keyboard navigation to ensure all buttons are accessible without a mouse.
- Use aria-label for context when button text alone might be ambiguous.
- Group related buttons logically with primary actions on the right in Western layouts.
Don't
- Don't use vague text like "Click Here", "Submit", or "Button" without context.
- Don't overuse primary buttons — limit to one primary action per section or page.
- Don't make buttons too small — ensure adequate touch targets (minimum 44px).
- Don't rely solely on color to convey button state or importance.
- Don't use too many button styles on a single page — maintain visual hierarchy.
- Don't forget disabled states — clearly indicate when buttons are unavailable.
- Don't make destructive actions too prominent — use appropriate styling for delete/remove actions.
- Don't ignore loading states — provide feedback during processing.
Keyboard Navigation
- Full keyboard access: All buttons are accessible via Tab key navigation and activated with Enter or Space.
- Logical tab order: Buttons follow the natural reading order and visual layout.
- Focus indicators: Clear visual focus states help keyboard users identify their current position.
- Disabled state handling: Disabled buttons are removed from tab order with
tabindex="-1".
Visual Accessibility
- High contrast ratios: All button styles meet WCAG AA contrast requirements for text and background.
- Multiple visual cues: Button states are indicated through color, typography, and other visual elements, not color alone.
- Adequate sizing: Buttons meet minimum touch target sizes (44px) for mobile accessibility.
- Clear state differentiation: Hover, focus, active, and disabled states are visually distinct.
Content Guidelines
- Action-oriented language: Use verbs that clearly describe what will happen ("Submit", "Download", "Cancel").
- Consistent terminology: Use the same words for the same actions throughout your site.
- Appropriate urgency: Match button styling to the importance and urgency of the action.
- Context-aware labels: Provide enough context so users understand the action without surrounding content.
Implementation Considerations
- Proper HTML semantics: Use
<button>for actions that don't navigate and<a>for links. - Form integration: Buttons in forms should have appropriate type attributes (submit, button, reset).
- Loading states: Provide feedback during processing with disabled states or loading indicators.
- Error handling: Clearly communicate when button actions fail and provide recovery options.
ARIA Attributes in Use
aria-label- Provides detailed action descriptions when button text is concise.aria-disabled="true"- Indicates disabled state for anchor-based buttons.disabled- Native disabled attribute for button elements.tabindex="-1"- Removes disabled buttons from keyboard navigation.