Skip to content

Sidebar โ€‹

A Vuetify-style navigation drawer with four modes โ€” permanent (always visible, pushes content), temporary (overlay drawer with scrim + Escape), rail (mini collapsed, optional expandOnHover), and auto (responsive: permanent on โ‰ฅ 768 px viewports, temporary below). Anchors left or right, three densities, three variants, seven colors. Three named slots โ€” header, default (body), footer โ€” designed to host a future <mono-menu> in the body. Writes its width to --mono-sidebar-{left,right}-width on :root so layout wrappers can pad themselves. Demos use the contained prop to position absolutely inside a scoped preview pane. Toggle Vue / CSS to switch the live demo and source together.

Permanent โ€‹

Always-visible sidebar that pushes the main content area to the side.

Vue SFC

Temporary โ€‹

Drawer-style sidebar with scrim โ€” Escape, scrim-click, or close button dismiss.

Vue SFC

Rail โ€‹

Mini collapsed sidebar (icons only); toggle expands to full width.

Vue SFC

Rail ยท expand on hover โ€‹

Rail mode that auto-expands while the cursor is over it.

Vue SFC

Rail ยท manual control โ€‹

Bind :rail to your own state and toggle it from any external button. The default chevron is hidden when the prop is provided.

Vue SFC

Location โ€‹

Anchor left or right.

Vue SFC

Colors โ€‹

Six themed accents plus the white surface default.

Vue SFC

Variants โ€‹

flat (no shadow), elevated (shadow), outlined (border).

Vue SFC

With nav list โ€‹

Sidebar housing a brand header, nav list, and footer โ€” the typical app-shell composition.

Vue SFC

With iconify icons โ€‹

Sidebar nav using mono-menu with i-mdi-* iconify classes โ€” paints SVG masks via currentColor.

Vue SFC

Customized โ€‹

Override per-element styling via cssClass (Vue) or utility classes (CSS).

Vue SFC

Types โ€‹

Importimport { SidebarProps } from 'mono-helper'
PropValueDefaultDescription
modelValuebooleanfalseControls whether the sidebar is open.
mode'auto' | 'permanent' | 'temporary' | 'rail''auto'Display mode: permanent, temporary, rail, or auto.
location'left' | 'right''left'Side of the viewport the sidebar is anchored to.
density'default' | 'compact' | 'comfortable''comfortable'Spacing density of the sidebar contents.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'surface''surface'Color theme applied to the sidebar.
variant'elevated' | 'outlined' | 'flat''elevated'Visual style variant of the sidebar.
widthnumber264Expanded width of the sidebar in pixels.
railWidthnumber64Collapsed rail width of the sidebar in pixels.
expandOnHoverbooleanfalseExpand the rail on hover while collapsed.
railnull | booleanโ€”External rail-state binding. Provide a boolean to take over the rail's expanded/collapsed state โ€” clicking any external button you wire up can mutate the bound value to flip the sidebar. Setting this prop also **hides the default chevron toggle**, since you're controlling the state. Omit (the default `null`) to keep the built-in chevron toggle.
containedbooleanfalseKeep the sidebar within its parent rather than the viewport.
persistentbooleanfalsePrevent the sidebar from closing on scrim click or Escape.
closeOnEscapebooleantrueClose the sidebar when the Escape key is pressed.
closeOnScrimbooleantrueClose the sidebar when the scrim is clicked.
lockScrollbooleantrueLock page scroll while a temporary sidebar is open.
showScrimbooleantrueShow the dimming scrim behind a temporary sidebar.
cssClassSidebarCssClass{}Custom CSS classes applied to internal sidebar parts.
cssClassNamestring''Root-level class name applied to the sidebar.