1.1.0 • Published 12 months ago

alertz v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

Alertz

  • Customize Alert & 2 Options

Preview

npm.io

Setup

npm install alertz

or

yarn add alertz

Usage

Alert

  • type="alert" (default)
import { useState } from 'react';
import { Alertz } from 'alertz';

function App() {
  const [open, setOpen] = useState(false);

  const handleClick = () => {
    setOpen(!open);
  };
  return (
    <div>
      <button onClick={handleClick}>Click</button>
      <Alertz show={open} buttonB={{ onClick: handleClick }} />
    </div>
  );
}

export default App;

2 Options

  • type="confirm"
import { useState } from 'react';
import { Alertz } from 'alertz';

function App() {
  const [open, setOpen] = useState(false);

  const handleClick = () => {
    setOpen(!open);
  };
  return (
    <div>
      <button onClick={handleClick}>Click</button>
      <Alertz type="confirm" show={open} buttonB={{ onClick: handleClick }} />
    </div>
  );
}

export default App;

Customize

  • Dark (Default) & Light Mode
<Alertz type="confirm" mode="light" title="Are You Sure ?" show={open} />
mode="dark"mode="light"
  • titleColor & bgColor
<Alertz
  bgColor="indigo"
  titleColor="yellow"
  type="confirm"
  title="Are You Sure ?"
  show={open}
/>
  • buttonsDirection="column" (default row)
<Alertz
  type="confirm"
  buttonsDirection="column"
  title="Are You Sure ?"
  show={open}
  buttonB={{ title: 'Confirm' }}
  buttonA={{ title: 'Cancel' }}
/>
1.1.0

12 months ago

1.0.2

12 months ago

1.0.19

12 months ago

1.0.18

12 months ago

1.0.17

12 months ago

1.0.16

12 months ago

1.0.15

12 months ago

1.0.14

12 months ago

1.0.13

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago

0.1.0

12 months ago