The Sidebar element provides a powerful, out-of-the-box solution for creating the main navigation menu for your application. It supports collapsible groups, icons, separators, and custom components for its header and footer sections.
How to Add a Sidebar
To add a Sidebar, find it in the “Elements” panel and drag it onto your page. It’s typically placed on the left side and set to fill the full height of the viewport.Configuration
All configuration for the sidebar is handled in the Custom section of the right-side properties panel.Header and Footer
You can add a custom header or footer to your sidebar, which is perfect for displaying a logo, a user profile, or action buttons.- Header Component: Select a component you have already created to render at the top of the sidebar.
- Footer Component: Select a component you have already created to render at the bottom of the sidebar.
Sidebar Content
This is the core of your sidebar. The Content property accepts an array of objects that defines the links, groups, and separators that make up your navigation. There are three types of objects you can add to this array:- Item: A single, clickable navigation link.
- Group: A collapsible section that contains other items.
- Separator: A visual dividing line.
- The `item` Object
- The `group` Object
- The `separator` Object
An Schema Breakdown:
item object creates a single navigation link.Type Definition (JSON):The text label that will be displayed for the link.
The URL that the user will be navigated to on click.
The name of an icon from the Lucide React
library to display next to the title.
If set to
true, the link will open in a new browser tab.A style object to apply custom CSS to the icon.