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

mini-notifier

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-notifier

Show notification, confirmation, prompt

  • 0.7.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

miniNotifier

Show notification, confirmation, prompt

Installation

npm install mini-notifier

Utilisation

<link rel="stylesheet" href="dist/style.css">
<script src="dist/mini-notifier.umd.cjs"></script>
<script>
  { notify, prompt, confirm, promptLogin, configure } = miniNotifier;
</script>

with a bundler like vite or webpack.

import { notify, prompt, confirm, promptLogin, configure } from 'mini-notifier';
import 'mini-notifier/dist/style.css';
notify('hello world');

notify(message, {
  time: 5000,
  style: 'success|error',
  position: 'top-left'
});

confirm('Are you sure ?', {
  okText: 'Yes',
  cancelText: 'Sorry, no',
  okHandler: () => console.log('ok'),
  cancelHandler: () => console.log('cancel')
});


prompt('Enter your email', {
  okText: 'Enter',
  okHandler: (data) => console.log('your email:', data),
  inputType: 'email',
  placeholder: 'team@ifmo.su'
})

notify('hello world', {
  container: document.querySelector('#box')
});

promptLogin('Login box', {
  loginText: 'Connectez-vous',
  emailText: 'Votre email',
  passwordText: 'Votre mot de passe',
  loginHandler: ({email, password}) => console.log('your email:', email, 'your password', password),
  rememberMe: true,
  rememberMeText: 'se souvenir'
})

configure({
  container: document.body,
  position: 'bottom-left',
  themePrefix: 'penta'
});

Theme

If you want to custom the MiniNotifier theme. You can define your own css vars.

:root {
  --primary-color500: #ffea66;

  --red500: #dc3545;
  --red200: #f8d7da;
  --green500: #2b5229;
  --green200: #e1fae1;

  --border-radius: .25rem;
}

in order to integrate as much as possible into your application, no css has been applied to the buttons.

If you want ready-to-go theme you can add pentatrion-theme package from npm.

import "pentatrion-theme/css/button.scss";
import "pentatrion-theme/css/text-textarea-select.scss";
import "pentatrion-theme/css/variables.scss";

Keywords

FAQs

Package last updated on 05 Dec 2022

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