Skip to content

Latest commit

 

History

History

snackbar

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@nexim/snackbar

Snackbar component with signal capability.

NPM Version npm bundle size Build & Lint & Test NPM Downloads NPM License

Overview

Snackbar component. It includes utilities for managing the snackbar's state and animations.

Installation

Install the package using npm or yarn:

npm install @nexim/snackbar

# Or using yarn
yarn add @nexim/snackbar

API

snackbarSignal

To display a snackbar, emit the snackbarSignal with the desired options:

import {snackbarSignal} from '@nexim/snackbar';

snackbarSignal.notify({
  content: 'This is a snackbar message',
  action: {
    label: 'Undo',
    handler: () => {
      console.log('Action button clicked');
    },
  },
  duration: '5s',
  addCloseButton: true,
});