cute-alert
v0.0.3
Published
Simple open source JavaScript library that aims to provide beautiful alerts and toasts to your website.
Downloads
60
Readme
Cute Alert
Simple open source JavaScript library that aims to provide beautiful alerts and toasts to your website. Alerts inspired by Igor Ferrão de Souza's design.
Visit the documentation for more detailed instructions or Storybook if you want to play around / check out the library.
Table of Contents
Getting started
Installation
npm install cute-alert
Usage
Alerts
import { cuteAlert } from 'cute-alert'
cuteAlert({
type: 'success',
title: 'Title',
description: 'Description',
timer: 5000,
primaryButtonText: 'Confirm',
secondaryButtonText: 'Cancel'
})
Check out the documentation for more detailed instructions.
Toasts
import { cuteToast } from 'cute-alert'
cuteToast({
type: 'success',
title: 'Title',
description: 'Description',
timer: 5000
})
Check out the documentation for more detailed instructions.
TypeScript
Cute alert has built-in TypeScript support and provides a set of default exported types that you can import as named imports into your project like:
import type {
AlertOptions,
ToastOptions,
AlertResolveValue,
ToastResolveValue,
AlertResolve,
ToastResolve
} from 'cute-alert'
Contributing
Before pushing a PR, take into account the following checklist:
- [ ] I have linked an issue or discussion.
- [ ] I have added tests (if necessary).
- [ ] I have updated the documentation accordingly (if necessary).
- [ ] My commits are following the conventional commits specification.
Setting up the project
Fork the repository and clone it.
Install the dependencies on the repository:
npm install
Start storybook:
npm run storybook
Unit tests
Running unit tests:
npm run test
Updating snapshots:
npm run test:update-snapshots
Coverage:
npm run coverage
Setting up the docs
Make sure you have the latest Ruby version installed.
Open up your terminal and install the
bundler
gem on version2.4.22
:gem install bundler -v 2.4.22
Go to the
docs
folder and install the dependencies:bundle install
Run
bundle exec jekyll serve
to serve the docs locally.