1.0.2 • Published 2 years ago

alert-momentum-ui v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

alert-momentum-ui

alert widget for cisco momentum-ui

JavaScript Style Guide npm version

Install

npm install --save alert-momentum-ui

Usage

import React from 'react';
import { AlertBox } from 'alert-momentum-ui';
//important: declare the box at root level of the app!
export default function App() {
  return (
      <div className="App">
        <AlertBox></AlertBox>
        <div>
          <InnerPage></InnerPage>
        </div>
      <div>);
}
// method for fire an alert box
import React from 'react';
import { Button } from "@momentum-ui/react";
import { AlertSuccess, AlertData } from 'alert-momentum-ui';

export default function InnerPage() {
  return (
    <div>
      <Button
        children="Show Alert"
        onClick={() => {
          AlertSuccess({
            title: "Example",
            message: "example message"
          } as AlertData);
        }}
        color="blue"/>
    <div>);
}

Demo

go to demo!

note: in the demo @momentum-ui/icons is not present.

License

MIT © silvio-pardo