Skip to content

GkNavigationDrawer

A navigation surface for app shells: v-model controls open state (when not permanent), temporary uses a Teleport to body with an optional scrim, slide transition, Escape to close, and body scroll lock while open. Without temporary and without permanent, the drawer is docked (fixed to the edge) when the viewport is above the mobile breakpoint; below 959px it becomes temporary unless disableResizeWatcher is set.

This is smaller than Vuetify’s VNavigationDrawer: no app layout item integration, touch drag, or sticky layout coupling — pair with your own main content padding / grid as needed.

When to use

Use for global app navigation and persistent section switching. Choose temporary mode for mobile overlays and docked/rail modes for desktop shell layouts.

Live demo

API

Props

PropTypeDefaultDescription
modelValueboolean | undefinedundefinedOpen state; undefined = auto (closed when overlay/temporary, open when docked desktop)
permanentbooleanfalseAlways visible; v-model does not collapse the drawer
temporarybooleanfalseForce overlay mode (scrim, teleport, transitions)
disableResizeWatcherbooleanfalseWhen true, never treat the viewport as “mobile” for auto-temporary
locationGkNavigationDrawerLocation'start'start / end use dir; left / right / top / bottom are physical
dir'ltr' | 'rtl''ltr'Maps start / end to sides
widthnumber | string256Full width (px or CSS length)
railbooleanfalseCollapsed rail width
railWidthnumber | string56Width when rail
expandOnHoverbooleanfalseWith rail, expand to width on hover; emits update:rail
scrimboolean | stringtruefalse hides scrim; string = CSS background
persistentbooleanfalseScrim click and Escape do not close (temporary only)
floatingbooleanfalseMargin + rounded corners (tokens)
imagestringBackground image URL
colorstringPanel background color
tostring | HTMLElement'body'Teleport target when temporary
zIndexnumber | stringtokenSets --gk-navigation-drawer-z-index
scrollLockbooleantrueLock document.body overflow when temporary and open
restoreFocusbooleantrueFocus first focusable on open; restore on close
tagstring'nav'Root element tag
touchlessbooleanfalseReserved (no touch drag in v1)

Additional attributes are forwarded to the root element (not duplicated on inner wrappers).

Slots

SlotSlot propsDescription
defaultMain content
prependAbove the default slot
appendBelow the default slot
imageimageCustom background; default uses image prop

Events

EventPayloadDescription
update:modelValuebooleanOpen state
update:railbooleanWith expandOnHover + rail, collapsed state while hovering ( false = expanded )

Tokens

TokenPurpose
--gk-navigation-drawer-widthDefault full width
--gk-navigation-drawer-rail-widthDefault rail width
--gk-navigation-drawer-z-indexStacking (portal + panel uses +1)
--gk-navigation-drawer-scrimScrim fill
--gk-navigation-drawer-bgPanel background
--gk-navigation-drawer-shadowPanel shadow
--gk-navigation-drawer-floating-marginfloating margin
--gk-navigation-drawer-floating-radiusfloating radius

Types

GkNavigationDrawerLocation and GkNavigationDrawerImageSlotProps are exported from god-kit/vue.

Examples

Basic

vue
<GkNavigationDrawer v-model="open" temporary>
  <nav>...</nav>
</GkNavigationDrawer>

Advanced

vue
<GkNavigationDrawer
  v-model="open"
  rail
  expand-on-hover
  location="start"
  dir="rtl"
/>

Edge case

vue
<GkNavigationDrawer
  v-model="open"
  temporary
  persistent
  :scroll-lock="false"
/>

Accessibility notes

  • Add a meaningful aria-label or visible heading for navigation regions.
  • In temporary mode, provide explicit close actions and keep focus targets inside drawer content.
  • Validate dir + location combinations in RTL apps.

Released under the MIT License.