# sajs

> simple alert

Latest version **0.2.3** (published 2020-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install sajs
pnpm add sajs
yarn add sajs
bun add sajs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2020-08-25 |
| First published | 2020-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | thiaguerd |
| Maintainers | thiaguerd |

## Links

- npm: https://www.npmjs.com/package/sajs
- Repository: https://github.com/thiaguerd/sajs
- Homepage: https://github.com/thiaguerd/sajs#readme
- Issues: https://github.com/thiaguerd/sajs/issues
- npm.io page: https://npm.io/package/sajs

## Dependencies (2)

- [jquery](https://npm.io/package/jquery.md) ^3.5.1
- [jquery.transit](https://npm.io/package/jquery.transit.md) ^0.9.12

## Recent versions

- 0.2.3 (latest) — 2020-08-25
- 0.2.2 — 2020-07-11
- 0.2.1 — 2020-02-01
- 0.2.0 — 2020-01-31
- 0.1.1 — 2020-01-31
- 0.1.0 — 2020-01-30

## README

# Simple Alert 

![npm](https://img.shields.io/npm/v/sajs)
[![install size](https://packagephobia.now.sh/badge?p=sajs)](https://packagephobia.now.sh/result?p=sajs)
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/sajs)

## Install

```
import sa from 'sajs'
```

## Examples

The basic:

```javascript
sa("This is a message!")
```
Call alert with title and message:

```javascript
sa("Hello!","This is a message!")
```
Callbacks functions:

```javascript
sa({
	title: "You are sure?",
	message: "You want delete this post?",
	onConfirm: function(){
		sa("Your post has been deleted.")
	},
	onClose: function(){
		sa("Your post is safe :)")
	}
})
```

Add class to butons:

```javascript
sa({
	message: "Adding css class to butons",
	closeClass: "btn_blue",
	confirmClass: "btn_red"
})
```

Change text from buttons

```javascript
sa({
	message: "Custom text",
	confirmText: "don't confirm that!",
	closeText: "close is safe"
})
```

Click on shadow to close alert

```javascript
sa({
	message: "Click on shadow to close",
	closeOnClickShadow: true
})
```

Set default class to close and confirm buttons

```javascript
SimpleAlert.bt_confirm_class = "btn btn-success"
SimpleAlert.bt_close_class   = "btn btn-default"
```

## Depencencies
- [transit](http://ricostacruz.com/jquery.transit/)
- [jquery](https://github.com/jquery/jquery/)


This is a npm package based from [here](http://github.com/thiaguerd/simple_alert)

---
_Source: https://npm.io/package/sajs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
