Skip to main content

Overview

Svelte Atoms Core components are built with accessibility in mind, providing semantic HTML, ARIA attributes, and keyboard navigation out of the box. All components follow WAI-ARIA authoring practices to ensure your applications are usable by everyone.
While components include accessibility features by default, you’re responsible for providing appropriate labels, descriptions, and context for your specific use case.

Semantic HTML

All atoms render semantic HTML elements by default, which can be customized using the as prop.

Default Semantic Elements

Always use the most appropriate semantic element for your content. This improves both accessibility and SEO.

ARIA Attributes

Components include ARIA attributes where appropriate. You can extend or override these as needed.

Buttons and Interactive Elements

Form Controls

Dialogs and Overlays

Keyboard Navigation

All interactive components support keyboard navigation following WAI-ARIA patterns.

Buttons

  • Enter: Activate button
  • Space: Activate button
  • Tab: Focus next element
  • Shift+Tab: Focus previous element
  • Enter/Space: Open/close dropdown
  • Arrow Down: Move to next item
  • Arrow Up: Move to previous item
  • Home: Move to first item
  • End: Move to last item
  • Escape: Close dropdown
  • Type to search: Filter items

Accordion

  • Enter/Space: Toggle accordion item
  • Tab: Move focus to next focusable element
  • Arrow Down: Move to next accordion header
  • Arrow Up: Move to previous accordion header
  • Home: Focus first accordion header
  • End: Focus last accordion header

Tabs

  • Arrow Left: Focus previous tab
  • Arrow Right: Focus next tab
  • Home: Focus first tab
  • End: Focus last tab
  • Tab: Move focus to active tab panel

Focus Management

Components handle focus management automatically for common patterns.

Dialog Focus Trap

Custom Focus Handling

Use lifecycle hooks for custom focus management:

Screen Reader Support

Announcements with ARIA Live Regions

Descriptive Labels

Color and Contrast

Ensure sufficient color contrast for text and interactive elements.
WCAG 2.1 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Use tools like WebAIM’s Contrast Checker to verify.

Motion and Animations

Respect user preferences for reduced motion:
Or use CSS:

Testing Accessibility

Manual Testing Checklist

  • All interactive elements are focusable
  • Focus order is logical
  • Focus is visible
  • No keyboard traps
  • All functionality available via keyboard
  • All content is announced properly
  • Form labels are associated correctly
  • Error messages are announced
  • Dynamic content changes are announced
  • Images have appropriate alt text
  • Text has sufficient contrast
  • Focus indicators are visible
  • Content is readable when zoomed to 200%
  • No information conveyed by color alone

Automated Testing

Use tools like axe-core for automated accessibility testing:

Accessibility Best Practices

Use Semantic HTML

Always use the most appropriate HTML element for the content

Provide Labels

Every form control must have an associated label

Keyboard Navigation

Ensure all functionality is accessible via keyboard

Test with Users

Test with real assistive technology users when possible

Next Steps

Animations

Learn about animation lifecycle hooks

Styling

Explore styling approaches for accessible design

Components

Browse all accessible components

WAI-ARIA

Read the official ARIA Authoring Practices Guide