JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q36345F
  • License MIT

A react component that you can use to render current error or success messages from a particular API endpoint

Package Exports

  • status-modal
  • status-modal/dist/index.js

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 (status-modal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

issues forks stars PRs Welcome license tweet

status-modal

A react component that you can use to render current error or success messages from a particular API endpoint

Basic usage

You can use this package by installing it with the command below

npm install status-modal

When you're done with the above step, simply import the component in your project. The snippet below shows a basic usage without some of the props

import React from "react";
import { Status } from "status-modal/dist";

export default function Home() {
  const message = "Hello status modal";

  return (
    <React.Fragment>
      <Status message={message} />
    </React.Fragment>
  );
}

By default the UI of the modal has a touch of green, which indicates a successful status message.

But, if you want to alter the style of the modal to fit the case of an error message, all you need to do is, add the status prop, and set its value to "error"

<Status message={message} status="error" />

Want to contribute?

Checkout the contributing guide on how to go about that.