Navigation & menus
Layout
MenuList
Menu’s rows rendered in the page instead of a dropdown. Use it for a sidebar or settings navigation that stays on screen.
Install
import { MenuList } from 'vael-ui'Playground
Fruits
Usage
<script setup lang="ts">
import { MenuList } from 'vael-ui'
const items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Cherry', value: 'cherry' },
]
</script>
<template>
<MenuList :items="items" />
</template>Motion New
MenuList: its appearance, and how the current-page indicator moves.
<MenuList
:motion="{ initial: { item: { opacity: 0, y: 4 } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | rootitemindicator | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
move | (parts, context) => animation | Moves its sliding indicator. A spring retimes it, and a move hook animates it with your own library, starting from context.from. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
| Key | Action |
|---|---|
| Tab | Moves focus from row to row; each row is a Tab stop, like any link. |
| ArrowDownArrowUp | Moves focus to the next or previous row, wrapping at the ends. |
| HomeEnd | Moves focus to the first or last row. |
| EnterSpace | Activates the focused row. |
| A letter | Moves focus to the next row whose label starts with the typed letters. |
- Renders a
<nav>landmark with native buttons or links, not menu roles. Passaria-labelwhen the page has more than one<nav>. - The row whose
valuematchesactivegetsaria-current="page". - Group labels are plain text and aren’t focusable. Separators have
role="separator".