Skip to content
Viewership Inquire
Astro UI

Glide Menu.

One highlight that glides to the hovered or focused row.

NavigationAtomNo dependencies Beautiful UI, MIT

.md

Draft 214 · Spring Trails

Install

  1. Import the foundation once

    foundation.css holds the tokens every component reads.

    Layout.astro
    ---
    // src/layouts/Layout.astro
    import "../styles/foundation.css";
    ---
  2. Copy the 2 files

    Paste into src/components/viewership/glide-menu/

  3. Use it

    Page.astro
    ---
    import GlideMenu from "../components/viewership/glide-menu/GlideMenu.astro";
    ---
    
    <GlideMenu />

Props 9

PropTypeDefaultDescription
as "div" | "nav" "div" Root element. You set the role.
rowSelector string "[data-menu-row]" Rows the highlight snaps to.
highlightBg string "var(--vs-hover)" Highlight background.
highlightRadius string "8px" Highlight corner radius.
highlightInset string "0px" Horizontal inset; negative bleeds past rows (sets --vs-glide-inset).
highlightClass string · Extra class on the highlight. Style with :global().
highlightStyle string · Extra highlight inline style.
arrowKeys boolean false Up, Down, Home, End move focus between rows (roving tabindex).
initGlideMenu(el, opts) (el: HTMLElement, opts?: GlideMenuOptions) => () => void · From glide-menu.ts: wire a script-built menu. Returns a teardown.

Source 2 files