Navigation & menus
Layout
Breadcrumb
A trail of links from the top of the site down to the current page. Use it on pages deep in a hierarchy.
Install
import { Breadcrumb } from 'vael-ui'Playground
Placement, behaviour and animation
Usage
<script setup lang="ts">
import { Breadcrumb, BreadcrumbItem, BreadcrumbSeparator } from 'vael-ui'
</script>
<template>
<Breadcrumb>
<BreadcrumbItem href="/">Home</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem href="/docs">Docs</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem current>Breadcrumb</BreadcrumbItem>
</Breadcrumb>
</template>Motion New
Breadcrumb: its appearance, crumb by crumb.
<Breadcrumb
:motion="{ initial: { item: { opacity: 0, y: 8 } }, stagger: 0.04 }"
/>| Name | Type | Description |
|---|---|---|
initialexit | rootitem | 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. |
staggerleavingappear | number | 'pop' | 'hold' | boolean | Items coming in together start stagger seconds apart. A leaving item lifts out so the rest close the gap ('pop'), or keeps its space until it's gone ('hold'). appear: true also brings in the items already there when it mounts. |
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
Follows the Breadcrumb pattern from the WAI-ARIA Authoring Practices Guide.
| Key | Action |
|---|---|
| TabShiftTab | Moves focus between the crumb links. |
- Renders a
<nav>landmark labeled with a translated “Breadcrumb”;ariaLabeloverrides it. The crumbs are an<ol>. - The current crumb, the last one by default, is plain text with
aria-current="page", not a link. - Separators and item icons are
aria-hidden. - Give each link an
href, ortofor a router link, throughattrsor onBreadcrumbItem.