1.6.3 • Published 3 months ago

react-mui-sidebar v1.6.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

React MUI Sidebar

React MUI Sidebar helps to create side Navigation.

Live Demo

Demo

Authors

Screenshots

App Screenshot

Installation

To install react mui sidebar npm package

  npm i react-mui-sidebar

Issues

For any Issues, create new issue on https://github.com/adminmart/react-mui-sidebar/issues

Usage/Examples

import React from "react";

import { Sidebar, Menu, MenuItem, Submenu, Logo } from "react-mui-sidebar";
import AccessAlarms from "@mui/icons-material/AccessAlarms";
import CottageOutlinedIcon from "@mui/icons-material/CottageOutlined";
{
  /* if you are using react then import link from  */
}
import { Link } from "react-router-dom";
{
  /* if you are using nextjs then import link from  */
}
import Link from "next/link";

const App = () => {
  return (
    <Sidebar width={"270px"}>
      <Logo
        component={Link}
        href="/"
        img="https://adminmart.com/wp-content/uploads/2024/03/logo-admin-mart-news.png"
      >
        AdminMart
      </Logo>
      <Menu subHeading="HOME">
        <MenuItem
          icon={<CottageOutlinedIcon />}
          component={Link}
          link="/tes"
          badge={true}
          isSelected={true}
        >
          {" "}
          {/* Set badge to boolean true */}
          Modern
        </MenuItem>
        <MenuItem icon={<AccessAlarms />} component={Link} link="/test">
          eCommerce
        </MenuItem>
        <MenuItem component={Link} link="/ana">
          Analytical
        </MenuItem>
      </Menu>
      <Menu subHeading="APPS">
        <MenuItem>Chat</MenuItem>
        <MenuItem>Calendar</MenuItem>
      </Menu>
      <Menu subHeading="OTHERS">
        <Submenu title="Menu Level">
          <MenuItem>Post</MenuItem>
          <MenuItem>Details</MenuItem>
          <Submenu title="Level 2">
            <MenuItem>new</MenuItem>
            <MenuItem>Hello</MenuItem>
          </Submenu>
        </Submenu>

        <MenuItem>Chip</MenuItem>
        <MenuItem target="_blank" component={Link} link="https://google.com">
          External Link
        </MenuItem>
      </Menu>
    </Sidebar>
  );
};

export default App;

API Reference

Sidebar Api Reference

  <Sidebar></Sidebar>
PropsTypeDefaultDescription
widthstring260pxset the width of sidebar
textColorstring#2b2b2bset this color to all MenuItem and SubMenu of sidebar
isCollapsebooleanfalseset the Sidebar to mini sidebar
themeColorstring#5d87ffset the theme primary color
themeSecondaryColorstring#49beffset the theme secondary color
modestringlightset the mode of the Sidebar light or Dark
directionstringltrset the direction of Sidebar ltr or rtl
userNamestringMathewset the user name of User Profile
designationstringDesignerset the user designation of User Profile
showProfilebooleantrueshow the user profile true or false
userimgstringuser image urlset the image of user in User Profile
onLogoutfunctionhandleLogoutset the logout function for user logout

Menu Api Reference

  <Menu></Menu>
PropsTypeDefaultDescription
subHeadingstringmenumenu heading title

Submenu Api Reference

  <Submenu></Submenu>
PropsTypeDefaultDescription
titlestringblanktitle of the submenu
iconcomponentmui icon - <FiberManualRecordIcon/>set icon of submenu
borderRadiusstring8pxset border radius of Submenu
textFontSizestring14pxset text Font Size of the submenu
disabledbooleanfalseenable/disable the Submenu

MenuItem Api Reference

  <MenuItem></MenuItem>
PropsTypeDefaultDescription
iconcomponentmui icon - <FiberManualRecordIcon/>set icon of menu item
linkstring#pass link for component to redirect
componentcomponentLinkset react router link or nextjs Link to apply route
badgebooleanfalseset the badge on menu items
badgeColorstringprimaryset badge color
badgeTextColorstring#ffffffset any badge text color
badgeContentstring6set content on badge
textFontSizestring14pxset font size of menu item
borderRadiusstring8pxset border radius of menu item
disabledbooleanfalseenable/disable the menu item
badgeTypestringfilledset badgeType of menu item filled or outlined
targetstring | set target of menu item _blank
isSelectedbooleanfalseset selected menu item

Logo Api Reference

  <Logo></Logo>
PropsTypeDefaultDescription
imgstringLogo urlset the logo of the sidebar
hrefstringset urlset any url you wanted to redirect
componentcomponentLinkset react router link or nextjs Link to apply route

Contributing

Contributions are always welcome!

Please adhere to this project's code of conduct.

1.4.6

5 months ago

1.6.3

3 months ago

1.4.5

5 months ago

1.6.2

4 months ago

1.4.4

5 months ago

1.6.1

4 months ago

1.4.3

5 months ago

1.6.0

4 months ago

1.4.2

5 months ago

1.4.1

6 months ago

1.4.0

6 months ago

1.5.9

5 months ago

1.5.8

5 months ago

1.5.7

5 months ago

1.3.9

6 months ago

1.5.6

5 months ago

1.5.5

5 months ago

1.5.4

5 months ago

1.5.3

5 months ago

1.5.2

5 months ago

1.5.1

5 months ago

1.5.0

5 months ago

1.4.9

5 months ago

1.4.8

5 months ago

1.4.7

5 months ago

1.3.7

11 months ago

1.3.6

11 months ago

1.3.8

11 months ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.2.8

1 year ago

1.3.0

1 year ago

1.2.9

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.2.3

1 year ago

1.1.4

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago