@codecraftkit
Documentation
The SideBar is used to have a menu in the left side of the screen.
it can be imported from the core.
import { SideBar } from "@codecraftkit/core";
or alone.
import SideBar from "@codecraftkit/sidebar";
function MyApp() {const options = {head: {title: '@codecraftkit',description: 'Documentation',img: '/images/avatars/code/negro.jpg'},menu: [{title: 'General'}, {route: '/',label: 'Getting Started',}, {route: '/custom-templates',label: 'Custom Templates',},{label: 'DataTable',subItems: [{route: '/data-table',label: 'DataTable'}, {route: '/data-table/head-types',label: 'DataTable Head Types'}, {route: '/data-table/styles',label: 'DataTable Styles'}]},{route: '/menu',label: 'Menu',}]}return <SideBarhead={options.head}menu={options.menu}menuSearch/>}
The props isResizable
and isCollapsible
doesn't work as expected in this environment
function MyApp(){const options = {menu: [{title: 'General'}, {route: '/',label: 'Getting Started',}, {route: '/custom-templates',label: 'Custom Templates',},{label: 'DataTable',subItems: [{route: '/data-table',label: 'DataTable'}, {route: '/data-table/head-types',label: 'DataTable Head Types'}, {route: '/data-table/styles',label: 'DataTable Styles'}]},{route: '/menu',label: 'Menu',}]}return <SideBarmenu={options.menu}header={<Grid placeItems='center'h='136px' templateRows='1fr auto'>header<Divider /></Grid>}body={<Grid placeItems='center' h='156px' >body</Grid>}footer={<Grid placeItems='center' h='50px' >footer</Grid>}menuItemsBodySpace='206px'/>}
head
object
no
object that contains title, description, img to customize the sidebar header
menu
array<objects>
no
Items inside the sidebar menu
isResizable
Boolean
no
Make the sidebar resizable
isCollapsible
Boolean
no
Make the sidebar collapsible
menuItemActiveColor
Color
no
blue.500
Current route item color
header
Component
no
Custom header component
body
Component
no
Custom body component, above the menu items
footer
Object
no
Custom footer component
menuSearch
Boolean
no
Show a search box for the menu items
menuItemsBodySpace
height
no
Height og the body component to handle menu items height