cute-alert
v0.0.3
Published
Simple open source JavaScript library that aims to provide beautiful alerts and toasts to your website.
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-alertUsage
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 installStart storybook:
npm run storybook
Unit tests
Running unit tests:
npm run testUpdating snapshots:
npm run test:update-snapshotsCoverage:
npm run coverageSetting up the docs
Make sure you have the latest Ruby version installed.
Open up your terminal and install the
bundlergem on version2.4.22:gem install bundler -v 2.4.22Go to the
docsfolder and install the dependencies:bundle installRun
bundle exec jekyll serveto serve the docs locally.
