JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 66
  • Score
    100M100P100Q84460F
  • License BSD-3-Clause

Integrate 'react-toastify' nicely in JupyterLab.

Package Exports

  • jupyterlab_toastify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jupyterlab_toastify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jupyterlab_toastify

Integrate 'react-toastify' nicely in JupyterLab.

example

Usage

import { INotification } from "jupyterlab_toastify";

// Error message notification - do not close automatically
INotification.error("Error");
// Warning message notification - do not close automatically
INotification.warning("Warning");
// Info message notification
INotification.info("Info");
// Success message notification
INotification.success("Success");

// Background task with progression animation
let id = INotification.inProgress("Task in progress!");
// -> Update text
INotification.update({
  toastId: id,
  message: "Updating task..."
});
// -> Update text, status and set closing delay (in ms)
INotification.update({
  toastId: id,
  message: "Task succeed",
  type: "success",
  autoClose: 3000
});

// Notification with two buttons
INotification.error("Error with button", {
  buttons: [
    {
      label: "Action1",
      callback: () => alert("Action1 was clicked")
    },
    {
      label: "Action2",
      callback: () => alert("Action2 was clicked")
    }
  ]
});

// Default call using `toast` function
// See https://github.com/fkhadra/react-toastify#usage
INotification.notify("Default");

To close a notification, click on the close button.

Prerequisites

Installation

jupyter labextension install jupyterlab_toastify

Changelog

v2.1.0

  • Update to JupyterLab 0.35
  • Update to react-toastify 4.4 => change enum for notifications type to react-toastify\TypeOptions

v2.0.0

  • API change: helper functions accept options in addition to the message
  • API change: update requires object as input and not a lot of arguments
  • New option buttons to add buttons with custom callback to the notification

v1.x

  • First version using react-toastify
  • Five scenarii:
    • Error
    • Warning
    • Info
    • Success
    • InProgress

Development

For a development install (requires npm version 4 or later), do the following in the repository directory:

npm install
npm run build
jupyter labextension install .

To rebuild the package and the JupyterLab app:

npm run build
jupyter lab build