@meksiabdou/alert-reactjs
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

@meksiabdou/alert-reactjs

Alert For ReactJs

bundlephobia npm JavaScript Style Guide license

Install

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

Props

Property Type default
className string undefined
show boolean false
type 'success' or 'error' or 'warning' or 'dark' success
message ReactNode or string undefined
customIcon ReactNode undefined
transitionTime number (ms) 250
alertStyle AlertStyle undefined
onHide function undefined

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

Readme

Keywords

Package Sidebar

Install

npm i @meksiabdou/alert-reactjs

Weekly Downloads

2

Version

2.0.3

License

MIT

Unpacked Size

90.3 kB

Total Files

25

Last publish

Collaborators

  • meksi.abdou