@nteract/mythic-notifications
TypeScript icon, indicating that this package has built-in type declarations

0.2.11 • Public • Published

@nteract/mythic-notifications

This package implements a notification system based on blueprintjs, using the myths framework.

Installation

$ yarn add @nteract/mythic-notifications
$ npm install --save @nteract/mythic-notifications

Usage

Initialize the package by including the notifications package in your store and rendering the <NotificationsRoot/>:

import { notifications, NotificationRoot } from "@nteract/mythic-notifications";
import { makeConfigureStore } from "@nteract/myths";

export const configureStore = makeConfigureStore({
  packages: [notifications],
});

export const App = () =>
    <>
      {/* ... */}
      <NotificationRoot darkTheme={false} />
    </>

Then dispatch actions made by sendNotification.create:

import { sendNotification } from "@nteract/mythic-notifications";

store.dispatch(sendNotification.create({
  title: "Hello World!",
  message: <em>Hi out there!</em>,
  level: "info",
}));

API

import { IconName } from "@blueprintjs/core";

export interface NotificationMessage {
  key?: string;
  icon?: IconName;
  title?: string;
  message: string | JSX.Element;
  level: "error" | "warning" | "info" | "success" | "in-progress";
  action?: {
    icon?: IconName;
    label: string;
    callback: () => void;
  };
}

Support

If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the pkg:mythic-notifications label.

License

BSD-3-Clause

/@nteract/mythic-notifications/

    Package Sidebar

    Install

    npm i @nteract/mythic-notifications

    Weekly Downloads

    394

    Version

    0.2.11

    License

    BSD-3-Clause

    Unpacked Size

    874 kB

    Total Files

    34

    Last publish

    Collaborators

    • hydrosquall
    • benabel
    • alexandercbooth
    • benrussert
    • mpacer
    • theengineear
    • yuvipanda
    • rgbkrk
    • lgeiger
    • ivanov
    • captainsafia
    • peggyrayzis
    • jdetle
    • hasch
    • willingc
    • stormpython
    • crystalline-cat
    • emeeks