Alap v3 Examples

Self-contained demos showing off the library.

Start Here

Theming

Offsets, per-anchor themes, custom item classes, image triggers
Menu styled entirely with Tailwind utilities
Advanced CSS effects using light DOM mode with standard <a class="alap"> elements
55+ CSS custom properties on <alap-link> for full theming and visual customization

Framework Adapters

<AlapProvider> + <AlapLink> + useAlap() hook — all rendering modes
<AlapProvider> + <AlapLink> + useAlap() composable — SFC templates
<AlapProvider> + <AlapLink> + useAlap() — Svelte 5 runes
<AlapProvider> + <AlapLink> + useAlap() — fine-grained reactivity
x-alap directive — no build step, sprinkle onto HTML
HTML fragment swaps — <alap-link> self-initializes after each swap
App Router pattern — Alap in a Next.js application

Positioning

All 9 compass placements, viewport fallback, center popover — DOM + web component
Visual test pages for the placement engine — verify menus never overflow the viewport

Renderers

Menu items displayed in a lightbox overlay instead of a dropdown
<alap-lightbox> custom element with ::part() styling and layout rearrangement
Detail inspection — click to view full metadata, tags, descriptions instead of navigating
<alap-lens> custom element — shadow DOM encapsulation and ::part() styling
YouTube, Vimeo, Spotify, CodePen, CodeSandbox — consent management, all renderer modes

Advanced

Image triggers, div triggers, image menu items, hover preview, context popup, event log
/key/opts syntax — field filtering, sorting, age limits, composition with operators
[text](alap:@macro) in Markdown becomes <alap-link> via remark-alap plugin
Inline <alap-link> nodes in a Tiptap editor — side-by-side with live preview
Load config from JSON files or remote endpoints
Zero npm, zero build step — load Alap via a <script> tag and go

Protocols

:atproto: protocol — live profiles, feeds, people search, post search, plus combined expressions
Fetch external JSON APIs with field mapping — 7 real APIs across menu, lightbox, and lens
rehype-alap plugin — transforms CMS HTML with <a href="alap:query"> into <alap-link>

Static Site Generators

These run locally from your checkout — not available on examples.alap.info.

cd examples/sites/eleventy && pnpm dev (port 9990)
cd examples/sites/astro-integration && ./serve.sh (port 9010)
cd examples/sites/hugo && ./run.sh (port 9170)
cd examples/sites/vitepress && pnpm dev