import React, { useState } from 'react'; import { Sidebar, RouteConfig } from '../layout/sidebar'; import { Home, Settings, User } from 'lucide-react'; import { BrowserRouter, useNavigate, useLocation } from 'react-router-dom'; // Wrapper wrapper to provide router context export function SidebarLogoExample() { return ( ); } function SidebarLogoContent() { const [expanded, setExpanded] = useState(true); const navigate = useNavigate(); const location = useLocation(); const routes: RouteConfig[] = [ { path: '/home', label: 'Home', icon: Home }, { path: '/profile', label: 'Profile', icon: User }, { path: '/settings', label: 'Settings', icon: Settings }, ]; const CustomLogo = (
C
CustomBrand
); const CustomLogoCollapsed = (
C
); return (
setExpanded(!expanded)} user={{ email: 'test@example.com' }} onLogout={() => console.log('Logout')} location={location} navigate={navigate} routes={routes} logo={CustomLogo} logoCollapsed={CustomLogoCollapsed} />

Sidebar with Custom Logo

This example demonstrates passing a custom logo component to the Sidebar.

Try toggling the sidebar to see the collapsed logo version.

); }