Skip to content

Menu

Menu

Navigation component for displaying a list of actions or navigation links.

Import

import Menu from '@primitivekit/svelte/Menu.svelte';

Basic Usage

<Menu>Content</Menu>

Props

No props available.

Customization

The Menu component supports CSS variables for complete customization:

<Menu style={{
  '--menu-bg-color': '#007bff',
  '--menu-text-color': '#ffffff'
}}>Custom</Menu>

Design Tokens

The following design tokens are available for customization:

  • --menu-background
  • --menu-border-width
  • --menu-border-style
  • --menu-border-color
  • --menu-border-radius
  • --menu-padding
  • --menu-min-width
  • --menu-item-margin
  • --menu-item-padding
  • --menu-item-height
  • … and 48 more

Accessibility

The Menu component is fully accessible and follows WCAG 2.1 AA standards:

  • ✅ Semantic HTML elements
  • ✅ Keyboard accessible
  • ✅ Focus visible indicator
  • ✅ Proper ARIA attributes
  • ✅ Screen reader compatible
  • ✅ Touch target size (44x44px minimum)
  • ✅ Color contrast compliance

Keyboard Navigation

KeyAction
TabMove focus to/from component
EnterActivate component
SpaceActivate component

Related Components

  • Link - Navigation component for creating accessible hyperlinks with various styles.
  • Breadcrumb - Navigation component for showing the current page location in a hierarchical structure.
  • Tabs - Navigation component for organizing content into multiple panels with tab selection.
  • Steps - Navigation component for showing progress through a multi-step process or wizard.
  • Pagination - Navigation component for splitting content across multiple pages with page controls.

See Also