New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@arturdoruch/flash-messenger

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arturdoruch/flash-messenger

Displays flash messages on the screen.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Flash messenger

Displays flash messages on the screen.

Install

yarn add @arturdoruch/flash-messenger

Usage

import FlashMessenger from '@arturdoruch/flash-messenger';

const flashMessenger = new FlashMessenger({
    // Options. See options description below.
});

// Adds messages with custom types to the stack. 
flashMessenger.add('error', 'An error occurred.');
flashMessenger.add('notice', 'Notice message.');
flashMessenger.add('success', 'Success message.');

// Displays messages of all types.
flashMessenger.display();

// Displays messages of specific type.
flashMessenger.display('error');

Global options

Global options applied to the all FlashMessenger instances. Set by calling function setOptions().

import { setOptions as flashMessengerSetOptions } from '@arturdoruch/flash-messenger';

flashMessengerSetOptions({
    // Options 
});
  • elementsClassPrefix string (default: flash-message)

    The class name prefix of the message container and item elements.

  • all the common options

Instance options

Options specific for FlashMessenger instance.

import FlashMessenger from '@arturdoruch/flash-messenger';

const flashMessenger = new FlashMessenger({
    // Options
});
  • containerClassName string (default: null)

    Adds custom class name for message container div element.

  • all the common options

Common options

Global and per instance FlashMessenger options.

  • removeAfter int|null (default: 5)

    Time (in seconds) after message item will be removed form the container. If null message item will not be removed until will be clicked.

  • removeOnClick boolean (default: true)

    Specifies whether the message item should be removed after clicking.

  • positionVertical string (default: top)

    Vertical position of displayed message container. One of: top, center, bottom.

  • positionHorizontal string (default: center)

    Horizontal position of displayed message container. One of: left, center, right.

CSS styles

For styling flash messages use existing CSS styles import '@arturdoruch/flash-messenger/styles/flash-messenger.css'; or create your own.

Keywords

FAQs

Package last updated on 19 Jul 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