Docs / Components / SideBar
ven.js

SideBar

venjs.sideBar(props) — a fixed left navigation drawer that is always open on desktop and collapses off-canvas on mobile.

Signature

venjs.sideBar(props) → VNode

Props

PropTypeDescription
isOpenbooleanWhen false, the drawer is hidden/translated off-screen (default true).
childrenVNode | VNode[]Drawer contents (nav links, headers, etc.).

Example

const open = venjs.signal(true);

venjs.sideBar({
  isOpen: open.value,
  children: [
    venjs.h3({ class: "sb-title" }, "Menu"),
    venjs.a({ href: "#/home", class: "sb-link" }, "Home"),
    venjs.a({ href: "#/settings", class: "sb-link" }, "Settings")
  ]
});
On desktop (md:) the sidebar is always visible at w-64. On mobile it becomes w-0 -translate-x-full unless isOpen opens it. Drive isOpen from a signal toggled by a hamburger button in your AppBar.