2.0.3 • Published 2 years ago

@meksiabdou/alert-reactjs v2.0.3

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

@meksiabdou/alert-reactjs

Alert For ReactJs

bundlephobia npm JavaScript Style Guide license

Install

yarn add @meksiabdou/alert-reactjs
npm install @meksiabdou/alert-reactjs

Props

PropertyTypedefault
classNamestringundefined
showbooleanfalse
type'success' or 'error' or 'warning' or 'dark'success
messageReactNode or stringundefined
customIconReactNodeundefined
transitionTimenumber (ms)250
alertStyleAlertStyleundefined
onHidefunctionundefined

Usage

import React, { useState } from 'react';

import Alert from 'alert-reactjs';
import 'alert-reactjs/dist/index.css';

const Home = () => {
  const [show, setShow] = useState(false);
  const [type, setType] = useState('success');

  return (
    <Alert
      type={type}
      message={
        <span>
          A simple danger alert with an
          <a href="#" style={{ fontWeight: 700, color: 'inherit' }}>
            example link
          </a>. Give it a click if you like.
        </span>
      }
      show={show}
      onHide={() => setShow(false)}
    />
  );
};

ScreensShot

Upload Tab

License

MIT © meksiabdou

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago