DXDashboardSidebar

DXDashboardSidebar

A collapsible sidebar navigation component for Laravel dashboards with support for navigation groups, icons, badges, and active state highlighting.

Live Examples

Props

NameTypeRequiredDefaultDescription
navigationNavigationYes-Navigation structure with groups and items. See Navigation type definition below
currentUrlstringYes-Current URL for determining active navigation items
collapsedbooleanNofalseWhether the sidebar is collapsed
titlestringNoDashboardSidebar title shown in the header

Events

NameParametersDescription
togglenoneEmitted when the sidebar should toggle between collapsed and expanded states

Slots

NameDescriptionScoped Props
brandCustom brand/logo content in the sidebar header. Receives collapsed (boolean) and title (string) as slot props-
linkCustom navigation link rendering. Receives item (NavigationItem), isActive (boolean), and collapsed (boolean) as slot props-

Extended Component

This is a custom component that extends beyond simple Bootstrap Vue Next wrappers, providing additional functionality specific to Laravel dashboards.

The Navigation type is an array of NavigationGroup objects:

interface NavigationItem {
  label: string;
  url: string;
  icon?: string;              // Icon component or emoji
  badge?: string | number;    // Badge content
  badgeColor?: string;        // Bootstrap colour variant
  active?: boolean;
  visible?: boolean;
}

interface NavigationGroup {
  label?: string;             // Group label (optional)
  items: NavigationItem[];
  collapsible?: boolean;
  collapsed?: boolean;
  visible?: boolean;
}

type Navigation = NavigationGroup[];

Features

  • Collapsible Design: Toggle between expanded and collapsed states
  • Navigation Groups: Organise navigation items into logical groups with labels
  • Active State: Automatically highlights active navigation items based on current URL
  • Icon Support: Display icons next to navigation items (works with component icons or emojis)
  • Badges: Show notification badges on navigation items
  • Sticky Positioning: Sidebar stays in view when scrolling
  • Custom Scrollbar: Styled scrollbar for better aesthetics
  • Flexible Rendering: Use slots to completely customise brand and link rendering