A powerful, customizable sidebar builder that allows you to create, style, and export production-ready sidebar components for your Next.js applications. Built with React, Next.js, and shadcn/ui, this tool provides an intuitive interface for developers to create beautiful, responsive sidebars.
- Visual Sidebar Builder: Design your sidebar with a real-time preview of how it will look in your application.
- Comprehensive Customization: Configure position, width, collapse behavior, and many other aspects of your sidebar.
- Dynamic Content Editing: Easily edit navigation items, projects, teams, and user profiles directly in the builder.
- Code Generation: Export production-ready code that you can directly use in your Next.js projects.
- Responsive Design: Create sidebars that work seamlessly across desktop and mobile devices.
- Shadcn/UI Integration: Leverages the beautiful, accessible components from the shadcn/ui library.
Check out the live demo of the Sidebar Builder here.
To get started with Sidebar Builder, follow these steps:
-
Clone the repository:
git clone https://github.com/hasanharman/shadcn-sidebar.git
-
Navigate into the project directory:
cd shadcn-sidebar -
Install the necessary dependencies:
npm install # or yarn install # or pnpm install
To start the development server, run:
npm run dev
# or
yarn dev
# or
pnpm devOpen your browser and navigate to http://localhost:3000 to see the application in action.
- Access the Builder: Once the app is running, you'll see the sidebar builder interface with a live preview.
- Configure Settings: Use the settings dialog to customize the sidebar's appearance and behavior.
- Edit Content: Use the content editor to customize navigation items, projects, teams, and user profile.
- Preview: See your changes in real-time in the preview area.
- Click the "Edit Sidebar Content" button to open the content editor.
- Navigate through the tabs to edit user profile, teams, navigation items, and projects.
- Add, remove, or modify items as needed.
- Click "Done" to apply your changes and see them in the preview.
- Switch to the "Code" tab to view the generated code.
- Browse through the different files that make up your sidebar component.
- Copy individual files or download all files as a ZIP.
- Follow the installation instructions in the README to integrate the sidebar into your project.
The Sidebar Builder generates several key components:
- AppSidebar: The main sidebar component that brings everything together.
- NavMain: Handles the main navigation items with collapsible sub-items.
- NavProjects: Displays project links with dropdown actions.
- NavUser: Shows the user profile with a dropdown menu.
- TeamSwitcher: Allows switching between different teams.
- Position: Choose between left and right sidebar positioning.
- Variant: Select from sidebar, floating, or inset variants.
- Width: Set custom width for desktop and mobile/collapsed states.
- Collapse Behavior: Choose between offcanvas (slide in/out), icon (collapse to icons), or none.
- Default Open: Set whether the sidebar should be open by default.
- Keyboard Shortcuts: Enable/disable keyboard shortcuts for toggling the sidebar.
- Show Header: Toggle visibility of the team switcher header.
- Show Footer: Toggle visibility of the user profile footer.
- Show Icons: Toggle visibility of icons in navigation items.
- Show Section Labels: Toggle visibility of section labels.
- Menu Button Size: Choose between default, small, or large button sizes.
The sidebar content can be fully customized:
- User Profile: Edit name, email, and avatar URL.
- Teams: Add, remove, or edit teams with custom names, icons, and plans.
- Navigation: Create hierarchical navigation with main items and sub-items.
- Projects: Define project links with custom names and icons.
When enabled, the sidebar can be toggled with:
- Mac: Cmd + B
- Windows/Linux: Ctrl + B
Contributions are welcome! If you would like to contribute to Sidebar Builder, please follow these steps:
- Fork the Repository: Click on the "Fork" button at the top right corner of the repository page.
- Create a Branch:
git checkout -b feature/YourFeatureName
- Make Changes: Implement your feature or fix.
- Commit Changes:
git commit -m "Add a feature" - Push Changes:
git push origin feature/YourFeatureName
- Create a Pull Request: Go to the original repository and create a pull request.
This project is licensed under the MIT License.
- Next.js - The React framework for production.
- shadcn/ui - Re-usable components built with Radix UI and Tailwind CSS.
- Lucide Icons - Beautiful & consistent icons.
- Zustand - A small, fast, and scalable state management solution.
- Tailwind CSS - A utility-first CSS framework for rapid UI development.
Built with ❤️ by Hasan Harman