bsr-left-sidebar
v2.2.45
Published
React component left sidebar
Downloads
2
Maintainers
Readme
bsr-left-sidebar
React component left sidebar
Install
npm install --save bsr-left-sidebar
Usage
import {LeftMenu, MenuItem, CreateItem} from "bsr-left-sidebar";
import 'bsr-left-sidebar/dist/index.css'
import React from "react";
import {TbPointFilled} from "react-icons/tb";
import {FaCaretDown, FaCaretRight} from "react-icons/fa";
import {RiMenuFill} from "react-icons/ri";
export default function P7_2(){
const listItems:MenuItem[]=[];
listItems.push(CreateItem({content:"menu1",icon:<RiMenuFill/>}))
listItems.push(CreateItem({content:"menu2",icon:<RiMenuFill/>}))
const m=new MenuItem();
m.content="menu3"
m.icon=<RiMenuFill/>
m.items?.push(CreateItem({content:"subMenu"}))
listItems.push(m)
return(
<div style={{display:"flex",width:"100%",height:"100%"}}>
<LeftMenu
iconTree={<TbPointFilled size={12}/>}
paddingItem={15}
minWidth={55}
width={350}
items={listItems}
iconClose={<FaCaretRight color={"#6c6b6b"}/>}
iconOpen={<FaCaretDown/>}
iconToggle={<RiMenuFill size={30} color={"yellow"}/>}
/>
<div>
Content
</div>
</div>
)
}
License
MIT © ionson100