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.
npm install cute-alert
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.
import { cuteToast } from 'cute-alert'
cuteToast({
type: 'success',
title: 'Title',
description: 'Description',
timer: 5000
})
Check out the documentation for more detailed instructions.
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'
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.
-
Fork the repository and clone it.
-
Install the dependencies on the repository:
npm install
-
Start storybook:
npm run storybook
Running unit tests:
npm run test
Updating snapshots:
npm run test:update-snapshots
Coverage:
npm run coverage
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.