svelte-floating-ui-a11y-menu Svelte Themes

Svelte Floating Ui A11y Menu

Work in progress, accessible menu demos with Svelte + Floating UI

🚧 Work in progress 🚧

Live demo: https://svelte-floating-ui-a11y-menu.vercel.app/

Local setup

  • npm install
  • npm run dev -- --open

Storybook v7 integration

TODOs

Technical information

I did not use {#if activeMenu == 'news'} around <ul>-submenus, because this removes submenus temporarily completely from DOM. I wasn't sure if this was okay with aria-controls= references (https://stackoverflow.com/a/73391142). Drawback is, that you can't use Svelte animations like in:fly={{ y: -10 }} on these submenus.

Instead I used a .hide-class (provided by Foxeye.Rinx), this does not remove elements from DOM. See feat: svelte-display directive #6336 #7932 for more details.

Resources

How was this created

npm create svelte@latest .
npm install @floating-ui/dom
npm i @picocss/pico sass svelte-preprocess

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes