npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mui-drawer

v1.0.12

Published

A reusable drawer component for React applications built with Material-UI (MUI).

Readme

mui-drawer

A reusable drawer component for React applications built with Material-UI (MUI).

Installation

# Using npm
npm install mui-drawer

# Using yarn
yarn add mui-drawer

Storybook

You can view all the components and their variations in our Storybook.

Features

  • Built with Material-UI (MUI) components
  • TypeScript support
  • Multiple drawer types:
    • Information
    • Input
  • Customizable widths and layouts
  • Support for primary, secondary, and tertiary actions
  • Responsive design
  • Theme customization
  • Sticky header and footer

Usage

import { MuiDrawer } from "mui-drawer";
import { DRAWER_TYPES, INFORMATION_SUBTYPES } from "mui-drawer";

// Basic Information Drawer
const MyComponent = () => {
  const [open, setOpen] = useState(false);

  return (
    <MuiDrawer
      type={DRAWER_TYPES.INFORMATION}
      subtype={INFORMATION_SUBTYPES.PASSIVE}
      open={open}
      onClose={() => setOpen(false)}
      title="Drawer Title"
      description="This is a drawer description"
      actions={{
        primaryCtaTitle: "Confirm",
        onPrimaryCtaClick: () => {
          // Handle primary action
          setOpen(false);
        },
      }}
    >
      {/* Optional content */}
    </MuiDrawer>
  );
};

Drawer Types

| Type | Description | Subtypes | Dismissibility | | ------------- | ----------------------------------- | ------------------------ | ----------------- | | information | For displaying information to users | progress, passive | Varies by subtype | | input | For collecting user input | default, destructive | partial |

Subtype Details

Information Drawer Subtypes

| Subtype | Description | Dismissibility | | ---------- | -------------------------------------- | -------------- | | progress | For showing progress or status updates | partial | | passive | For passive information display | full |

Input Drawer Subtypes

| Subtype | Description | Dismissibility | | ------------- | ----------------------------- | -------------- | | default | Standard input | partial | | destructive | For destructive input actions | partial |

Props Reference

Base Props

| Prop | Type | Required | Default | Description | | ---------------------- | --------------------------- | -------- | ------- | ------------------------------- | | type | "information" \| "input" | Yes | - | Type of the drawer | | subtype | string | Yes | - | Subtype of the drawer | | open | boolean | Yes | - | Controls drawer visibility | | onClose | () => void | Yes | - | Callback when drawer is closed | | title | string | No | - | Drawer title | | subTitle | string \| React.ReactNode | No | - | Drawer subtitle | | description | string | No | - | Drawer description | | children | React.ReactNode | Yes | - | Drawer content | | wrapperClassName | string | No | - | Custom class for drawer wrapper | | bodyWrapperClassName | string | No | - | Custom class for body wrapper | | showCloseIcon | boolean | No | true | Show/hide close icon | | showDivider | boolean | No | true | Show/hide divider | | showActions | boolean | No | true | Show/hide action buttons | | width | string | No | - | Custom width of the drawer | | maxWidth | string | No | - | Maximum width of the drawer |

Action Props

| Prop | Type | Required | Default | Description | | ------------------------- | ----------------- | -------- | ----------------------------------------------- | --------------------------------------- | | primaryCtaTitle | string | No | - | Primary button text | | secondaryCtaTitle | string | No | - | Secondary button text | | tertiaryCtaTitle | string | No | - | Tertiary button text | | primaryCtaTooltipText | string | No | - | Tooltip text for primary button | | secondaryCtaTooltipText | string | No | - | Tooltip text for secondary button | | tertiaryCtaTooltipText | string | No | - | Tooltip text for tertiary button | | isPrimaryCtaLoading | boolean | No | false | Show loading state for primary button | | isSecondaryCtaLoading | boolean | No | false | Show loading state for secondary button | | isTertiaryCtaLoading | boolean | No | false | Show loading state for tertiary button | | isPrimaryCtaDisabled | boolean | No | isSecondaryCtaLoading or isTertiaryCtaLoading | Disable primary button | | isSecondaryCtaDisabled | boolean | No | isPrimaryCtaLoading or isTertiaryCtaLoading | Disable secondary button | | isTertiaryCtaDisabled | boolean | No | isPrimaryCtaLoading or isSecondaryCtaLoading | Disable tertiary button | | onPrimaryCtaClick | () => void | No | - | Primary button click handler | | onSecondaryCtaClick | () => void | No | - | Secondary button click handler | | onTertiaryCtaClick | () => void | No | - | Tertiary button click handler | | tertiaryCtaStartIcon | React.ReactNode | No | - | Icon for tertiary button |

Responsive Design

The drawer component is fully responsive and adapts to different screen sizes:

  • On mobile devices (max-width: 600px):
    • Takes full width and height
    • Stacks action buttons vertically
    • Adjusts content height based on header and footer presence
    • Optimizes spacing for different numbers of action buttons

Development

Local Setup

# Install dependencies
yarn install

# Build package
yarn build

Local Development with yarn link

To test the package in another project locally:

  1. In the mui-drawer directory:
# Build the package
yarn build

# Create a global symlink
yarn link
  1. In your project directory:
# Link to the package
yarn link "mui-drawer"
  1. To unlink when done:
# In your project directory
yarn unlink "mui-drawer"

# In the mui-drawer directory
yarn unlink

Note: After making changes to the package, you'll need to:

  1. Rebuild the package (yarn build)

License

© [Virtual Internships]