Specifies the main content area displayed alongside a Sidebar.
Contains the primary content within a SidebarLayout.
import { useState } from "react";
import { Sidebar, SidebarLayout, SidebarMain, SidebarTrigger } from "@syncfusion/react-navigations";
export default function App() {
const [open, setOpen] = useState(false);
return (
<SidebarLayout>
<Sidebar
open={open}
onOpenChange={(e) => setOpen(e.open)}
>
<nav>
<ul>
<li>Dashboard</li>
<li>Projects</li>
<li>Settings</li>
</ul>
</nav>
</Sidebar>
<SidebarMain>
<SidebarTrigger aria-label="Toggle navigation">
☰
</SidebarTrigger>
<div>
<h1>Dashboard</h1>
<p>Welcome to the dashboard.</p>
</div>
</SidebarMain>
</SidebarLayout>
);
}
The following table outlines the props for the SidebarMainProps:
| Name | Type | Default | Description |
|---|
| children | node | - | Specifies the content of the main area. |