Root Styles
The Root Style feature provides the flexibility to apply custom styling to the menu section. With the rootStyles
prop, you can pass a set of CSS properties to customize the appearance of the menu section according to your design preferences. The rootStyles
prop accepts a CSSObject from the Emotion library.
Props
type RootStylesType = {
rootStyles?: CSSObject
}
Example
/vertical-menu/menu-section/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>
<MenuSection
label='Dashboards & Apps'
rootStyles={{
backgroundColor: '#e4e2ff',
color: '#7367F0 !important'
}}
>
<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