Root Styles
The Root Style feature provides the flexibility to apply custom styling to the navigation sidebar. With the rootStyles
prop, you can pass a set of CSS properties to customize the appearance of the sidebar according to your design preferences. The rootStyles
prop accepts a CSSObject from the Emotion library.
Props
type RootStylesType = {
rootStyles?: CSSObject
}
Example
/vertical-menu/menu/root-styles
Source Code
'use client'
// Component Imports
import VerticalNav, { Menu, MenuItem, MenuSection, SubMenu } from '@menu/vertical-menu'
const RootStyles = () => {
return (
<VerticalNav customBreakpoint='200px'>
<Menu
rootStyles={{
backgroundColor: '#f2fdff',
color: '#00a2ff'
}}
>
<MenuSection label='Dashboards & Apps'>
<SubMenu label='Dashboards'>
<MenuItem>Analytics</MenuItem>
<MenuItem>eCommerce</MenuItem>
</SubMenu>
<MenuItem>Calendar</MenuItem>
</MenuSection>
<MenuSection label='Others'>
<MenuItem>FAQ</MenuItem>
<SubMenu label='Menu Level'>
<MenuItem>Menu Level 2.1</MenuItem>
<SubMenu label='Menu Level 2.2'>
<MenuItem>Menu Level 3.1</MenuItem>
<MenuItem>Menu Level 3.2</MenuItem>
</SubMenu>
</SubMenu>
<MenuItem>Documentation</MenuItem>
</MenuSection>
</Menu>
</VerticalNav>
)
}
export default RootStyles