@snackstack/mui
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

@snackstack/mui

A Material UI adapter for @snackstack/core

Latest version published to npm.js npm downloads per month Project license

Installation

To install @mui/material, follow their installation guide.

⚠️ Note: Only @mui/material v5 or later is supported.

To install the latest stable version with npm, run the following command:

npm install @snackstack/core @snackstack/mui

Or if you're using yarn:

yarn add @snackstack/core @snackstack/mui

Setup

Make sure you have setup the SnackProvider component as shown in the Get started section of the documentation.

Then you just need to import the MuiSnack component and pass it as the value for the Component property on the SnackStack component.

import React from 'react';
import ReactDOM from 'react-dom/client';
import { SnackProvider, SnackStack, SnackManager } from '@snackstack/core';
+ import { MuiSnack } from '@snackstack/mui';

const snackManager = new SnackManager({ maxSnacks: 7 });

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);

root.render(
  <React.StrictMode>
    <SnackProvider manager={snackManager}>
      <App />

+     <SnackStack Component={MuiSnack} />
    </SnackProvider>
  </React.StrictMode>

Learn more about the Material UI adapter

Learn more about managing notifications

Package Sidebar

Install

npm i @snackstack/mui

Weekly Downloads

1

Version

1.3.1

License

MIT

Unpacked Size

34.8 kB

Total Files

13

Last publish

Collaborators

  • tobiastengler