Overview
Mintlify Components is built with accessibility in mind, following WAI-ARIA best practices. All interactive components include proper ARIA attributes, keyboard navigation support, and focus management.The library uses
@base-ui/react and @headlessui/react for accessible component primitives.ARIA Attributes
Components use ARIA attributes to provide context for assistive technologies.Accordion Component
Frompackages/components/src/components/accordion/accordion-cover.tsx:24-31:
aria-controls: Links the trigger to the content it controlsaria-expanded: Indicates whether the accordion is open or closedaria-labelledby: Associates the content region with its labelrole="region": Identifies the content as a landmark region
Tabs Component
Frompackages/components/src/components/tabs/tabs.tsx:165-199:
role="tablist": Identifies the tab containerrole="tab": Identifies each tab triggerrole="tabpanel": Identifies each content panelaria-selected: Indicates the active tabaria-controls: Links tabs to their panelsaria-labelledby: Associates panels with their tabsaria-hidden: Hides inactive panels from screen readers
Tooltip Component
Frompackages/components/src/components/tooltip/tooltip.tsx:59-79:
aria-label based on content:
Card Component
Frompackages/components/src/components/card/card.tsx:192-193:
- Decorative icons use
aria-hidden="true"to hide from screen readers - Links and buttons have descriptive text for context
Color Component
Frompackages/components/src/components/color/color.tsx:127-129:
aria-label: Descriptive label for the color buttonaria-pressed: Indicates copy statearia-roledescription: Describes the button’s purpose
Keyboard Navigation
All interactive components support keyboard navigation.Tabs Keyboard Support
Frompackages/components/src/components/tabs/tabs.tsx:118-154:
ArrowLeft: Previous tabArrowRight: Next tabHome: First tabEnd: Last tabEnterorSpace: Activate tabTab: Move focus out of tab list
Accordion Keyboard Support
Accordions use the native<details> element:
EnterorSpace: Toggle accordionTab: Navigate between accordions
Using the native
<details> element provides built-in keyboard support and proper semantics.Steps Keyboard Support
Frompackages/components/src/components/steps/steps.tsx:179-180:
Tab: Navigate between step anchor linksEnter: Copy anchor link and update URL hash
Focus Management
Components implement proper focus management for keyboard users.Focus Styles
Frompackages/components/src/components/card/card.tsx:168:
packages/components/src/components/tooltip/tooltip.tsx:82-84:
- Remove default outline with
outline-none - Add custom focus ring with
ring-2 - Use theme primary color for consistency
- Add ring offset for better visibility
Tab Index Management
Frompackages/components/src/components/tabs/tabs.tsx:199:
- Active tab:
tabIndex={0}(keyboard focusable) - Inactive tabs:
tabIndex={-1}(not in tab order) - Content panels: Match their tab’s active state
Focus Trapping
Tooltips implement focus behavior based on device capabilities:Semantic HTML
Components use semantic HTML elements when possible.List Semantics
Frompackages/components/src/components/steps/steps.tsx:274-278:
Landmark Roles
While divs with ARIA roles are used for styling flexibility, the library aims to use semantic HTML wherever possible.
Screen Reader Support
Callout Variants
Frompackages/components/src/components/callout/callout.tsx:36-78:
aria-label for screen readers:
Hidden Content
Color Contrast
All components maintain WCAG AA contrast ratios.Text Contrast
Frompackages/components/src/components/badge/badge.tsx:29-48:
- Light mode: Dark text on light backgrounds
- Dark mode: Light text on dark backgrounds
- Minimum 4.5:1 ratio for normal text
- Minimum 3:1 ratio for large text
Interactive States
Button States
Frompackages/components/src/components/badge/badge.tsx:125-144:
- Default: Normal appearance
- Hover: Reduced opacity or color change
- Focus: Visible focus ring
- Active: Pressed state
- Disabled: Reduced opacity, not focusable
Link States
Frompackages/components/src/components/tooltip/tooltip.tsx:123:
Best Practices
Testing Accessibility
Tools
- axe DevTools: Browser extension for automated testing
- NVDA/JAWS: Screen reader testing on Windows
- VoiceOver: Screen reader testing on macOS/iOS
- Keyboard only: Test without using a mouse
- Wave: Web accessibility evaluation tool
Manual Testing Checklist
For more information on WCAG guidelines, visit the W3C Web Accessibility Initiative.