Sidebar

A responsive sidebar component that can be used for navigation, menus, or any other content that needs to be displayed in a side panel. It supports both full-width and mini modes, and can be configured to appear on hover.

Please note, Sidebar must always be placed within a <div class="vui-sidebar-layout" /> element. Similar to Drawer

My page

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Atque deleniti asperiores quibusdam et commodi deserunt libero officia doloremque. Possimus ipsum sunt odit culpa consequatur hic reiciendis doloremque consequuntur tempore excepturi?


Yes that's correct

  • Secure
  • Reliant
  • Ublumf

Props

NameDefaultType
width224number
Width of the sidebar in pixels when in full mode
minifalseboolean
Whether to display the sidebar in mini mode (collapsed)
appearfalseboolean
Whether the sidebar should appear on hover at the left edge of the screen
floatyfalseboolean
Whether to add edges of background around the sidebar

Events

Sidebar is controlled via v-model, because it can also close itself and this change should be propagated to the parent.

NamePayloadDescription
update:modelValueEmitted when the sidebar's open state changes

Slots

All slots expose the same properties, which allow the UI to control the state of the Sidebar.

NameAcceptsDescription
defaultSidebarExposeMain content of the sidebar
headerSidebarExposeContent to display at the top of the sidebar
footerSidebarExposeContent to display at the bottom of the sidebar
interface SidebarExpose {
  mini: Ref<boolean>
  floaty: Ref<boolean>
  width: Ref<number>
  open: Ref<boolean>
  close: () => void
}

Examples

Appear sidebar

This sidebar will appear automatically whenever the curosor is close to the edge of the sidebar wrapper on the left side.

The sidebar uses the following configurations:

  • appear - The sidebar will appear automatically whenever the curosor is close to the edge of the sidebar wrapper.
  • floaty - The sidebar will float over the main content.
  • width - The width of the sidebar in pixels when in full mode.