1.3.3 • Published 3 years ago

@bapana/react-sidebar v1.3.3

Weekly downloads
36
License
MIT
Repository
github
Last release
3 years ago

@bapana/react-sidebar

Completely customizable modern sidebar built with light weight and modern libraries available in the market

NPM JavaScript Style Guide

Install

npm install --save @bapana/react-sidebar

Usage

import React from 'react'
// Sidebar Component
import Sidebar from '@bapana/react-sidebar'
import '@bapana/react-sidebar/lib/index.css'
// Icons for the menu and sub menu items
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import {
  faAddressBook,
  faAddressCard,
  faBookmark,
  faRetweet
} from '@fortawesome/free-solid-svg-icons'

const ExampleComponent = () => {
  const brandName = {
    name: 'Hello',
    logoPath: '/images/logo.png'
  }

  const menuList = [
    {
      name: 'Home',
      icon: <FontAwesomeIcon icon={faAddressBook} />,
      to: '/',
      hasChildren: false,
      subMenu: []
    },
    {
      name: 'Dashboard',
      icon: <FontAwesomeIcon icon={faAddressCard} />,
      to: '/dashboard',
      hasChildren: true,
      subMenu: [
        {
          name: 'Board',
          icon: <FontAwesomeIcon icon={faBookmark} />,
          to: '/board'
        },
        {
          name: 'Report',
          icon: <FontAwesomeIcon icon={faRetweet} />,
          to: '/report'
        }
      ]
    }
  ]

  return <Sidebar brandName={brandName} menuList={menuList} />
}

Styles Customization

Passing the theme property to Sidebar component as below will adopt the given color patterns

KeyDescription
headerSidebar Header color code
menuItemMenu items color code
expandArrowMenu expand arrow color code
toggleToggle arrow color code
sidebarSidebar color code

below is the default color code

theme: {
    header: {
      color: '#bdc3c7',
      hoverColor: '#ecf0f1',
      backgroundColor: '#222f3e'
    },
    menuItem: {
      color: '#bdc3c7',
      hoverColor: '#ecf0f1',
      active: '#1abc9c',
      activeHoverColor: '#1dd1a1'
    },
    expandArrow: {
      color: '#ecf0f1'
    },
    toggle: {
      color: '#bdc3c7',
      hoverColor: '#ecf0f1'
    },
    sidebar: {
      backgroundColor: '#222f3e',
      color: '#bdc3c7'
    }
  }

License

MIT © Parthiban Baskar

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.24

3 years ago

1.2.23

3 years ago

1.2.21

3 years ago

1.2.22

3 years ago

1.2.20

3 years ago

1.2.19

3 years ago

1.2.18

3 years ago

1.2.16

3 years ago

1.2.17

3 years ago

1.2.15

3 years ago

1.2.14

3 years ago

1.2.13

3 years ago

1.2.12

3 years ago

1.1.11

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.10

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago