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

CSS Variables โ€‹

Vue SFC

Every sidebar is themed through --mono-sidebar-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ€” custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-sidebar> and the shadow build. The density and color props set presets, but an explicit --mono-sidebar-* override always wins. To re-skin globally, set the underlying --theme-* tokens.

width / rail-width are usually set via the props (they're also exposed as --mono-sidebar-width / --mono-sidebar-rail-width). The separate --mono-sidebar-{left,right}-width on :root are the layout-padding values the sidebar writes for content wrappers.

VariableDefaultControls
--mono-sidebar-accent--theme-primaryAccent (scrollbar, rail toggle, painted bg); set by color
--mono-sidebar-bg--theme-surfacePanel background (painted by non-surface colors)
--mono-sidebar-surface--theme-surfacePanel / rail-toggle surface
--mono-sidebar-text--theme-textPanel text color
--mono-sidebar-text-softtext 62%Muted text / rail-toggle color
--mono-sidebar-border--theme-borderoutlined border + rail-toggle border
--mono-sidebar-border-liteborder 55%Header/footer/topbar dividers
--mono-sidebar-width264pxExpanded width (usually via width prop)
--mono-sidebar-rail-width64pxCollapsed rail width (usually via rail-width prop)
--mono-sidebar-pad-x0.85remSection horizontal padding (set by density)
--mono-sidebar-pad-y0.85remSection vertical padding (set by density)
--mono-sidebar-gap0.4remRail-bar gap (set by density)
--mono-sidebar-shadowaccent glowelevated shadow
--mono-sidebar-scrim-bgrgba(15,25,45,.42)temporary overlay scrim
--mono-sidebar-z50Panel z-index

Types โ€‹

Importimport { SidebarProps } from 'mono-helper'
PropValueDefaultDescription
modelValuebooleanโ€”Controls whether the sidebar is open.
mode'auto' | 'permanent' | 'temporary' | 'rail'โ€”Display mode: permanent, temporary, rail, or auto.
location'left' | 'right'โ€”Side of the viewport the sidebar is anchored to.
density'default' | 'compact' | 'comfortable'โ€”Spacing density of the sidebar contents.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'surface'โ€”Color theme applied to the sidebar.
variant'elevated' | 'outlined' | 'flat'โ€”Visual style variant of the sidebar.
widthnumberโ€”Expanded width of the sidebar in pixels.
railWidthnumberโ€”Collapsed rail width of the sidebar in pixels.
expandOnHoverbooleanโ€”Expand 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.
containedbooleanโ€”Keep the sidebar within its parent rather than the viewport.
persistentbooleanโ€”Prevent the sidebar from closing on scrim click or Escape.
closeOnEscapebooleanโ€”Close the sidebar when the Escape key is pressed.
closeOnScrimbooleanโ€”Close the sidebar when the scrim is clicked.
lockScrollbooleanโ€”Lock page scroll while a temporary sidebar is open.
showScrimbooleanโ€”Show 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.