Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flive/react-navigation-drawer

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flive/react-navigation-drawer

Navigation drawer displayed in overlay

  • 5.0.0
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-91.67%
Maintainers
3
Weekly downloads
 
Created
Source

react-navigation-drawer

This module displays a navigation drawer that appears as an overlay, it extend react-kit Modal.

Install

npm install @flive/react-navigation-drawer

Code example

 Simple example with menuLinks, navigation tree as a json for generating accordions.

<NavigationDrawer
  title="Menu"
  onChange={({ state }) => console.log({ state })}
  toggle={
    <Button variant="secondary" type="button">
      Simple example
    </Button>
  }
  userProfile={{
    avatarIdentifier: 'my@email.com',
    content: 'First name, Last name',
    linkComponent: 'a'
  }}
  menuLinks={[
    {
      label: 'Link label 1',
      key: 'link1',
      children: [
        { label: 'Link label 2', key: 'link2', linkComponent: 'a' },
        { label: 'Link label 3', key: 'link3' }
      ]
    },
    {
      label: 'Link label 2',
      key: 'link2',
      children: [
        { label: 'Link label 2', key: 'link2' },
        {
          label: 'Link label 3',
          key: 'link3',
          children: [{ label: 'Link label 4', key: 'link4' }]
        }
      ]
    },
    { label: 'Link label 3', key: 'link3' },
    { label: 'Link label 4', key: 'link4' }
  ]}
/>

Custom example with a child as function

<NavigationDrawer
  title="Menu"
  onChange={({ state }) => console.log({ state })}
  toggle={
    <Button variant="secondary" type="button">
      Custom render
    </Button>
  }
  userProfile={{
    avatarImgSource:
      'https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50',
    content: 'Helena Brauer'
  }}
>
  {({ handleClose }) => (
    <Accordion margin="none" boxShadow="none">
      <AccordionItem label="Level 1 label">
        <Accordion>
          <AccordionLink onClick={handleClose}>Accordion link 1</AccordionLink>
          <AccordionLink onClick={handleClose}>Accordion link 2</AccordionLink>
          <AccordionLink onClick={handleClose}>Accordion link 3</AccordionLink>
          <AccordionItem label="Level 2 label">
            <Accordion>
              <AccordionLink onClick={handleClose}>
                Accordion link 4
              </AccordionLink>
              <AccordionLink onClick={handleClose}>
                Accordion link 5
              </AccordionLink>
              <AccordionLink onClick={handleClose}>
                Accordion link 6
              </AccordionLink>
              <AccordionItem label="Level 3 label">
                <AccordionLink onClick={handleClose}>
                  Accordion link 6
                </AccordionLink>
              </AccordionItem>
            </Accordion>
          </AccordionItem>
        </Accordion>
      </AccordionItem>
      <AccordionLink onClick={handleClose}>Accordion link 2</AccordionLink>
      <AccordionLink onClick={handleClose}>Accordion link 3</AccordionLink>
    </Accordion>
  )}
</NavigationDrawer>

License

This project is licensed under a custom license. See the LICENSE file for details.

FAQs

Package last updated on 22 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc