Coder Social home page Coder Social logo

toast-ifications's Introduction

๐Ÿž Toast-ifications

Table of Contents

About the project

Toastifications is a toast notification component library, for creating simple and elegant notifications for your web based site or application.

Screenshot

Tech Stack

VanillaJS: Vanilla JS, SCSS (CSS pre-complied), HTML

ReactJS: React.JS, Vite (dev testing), SCSS, HTML

GettingStarted

Toastifications is currently available for VanillaJS and ReactJS, more framework support is coming soon! To get started find your corresponding framework below:

๐Ÿฆ Vanilla JS

Installation

Install toast-ifications by linking the script and style files in your project.

<script src="./toastComponent.js" charset="utf-8" defer></script>
<link rel="stylesheet" href="./toastStyle.css">

Usage

To get started you need to init the ToastNotification class and set some options.

new ToastNotification({notificationType: 'info', message: 'Hello World'}).render();

โš›๏ธ React JS

Installation

Install toast-ifications by importing the component file into your project.

import ToastNotification from './components/toastNotification';

Usage

To get started you need to init the ToastNotification class and set some options.

<ToastNotification notificationData={{notificationType: 'info', message: 'Hello World'}} />

Option examples

Here is an example object to render a personalised component, none of the options are strictly required, but I do recommend at least setting the notificationType and message.

The rest of the options, if not set, are set to default values.

{
	notificationType:		'error',
	notificationAction:	  	'none',
	title:				 	'Workout Completed!',
	message:				'You have Successfully completed your workout, congrats! Keep up the good work!',
	messageExtended:		false,
	theme:					'dark',
	time:					'2022-06-04 0:35:00',
	icon:					'hammer-outline',
	animated:				true,
	autodelete:				false
}

Notification functionality parameters

These parameters affect the base appearance and functionality of the component.

Parameter Type Description
notificationType string Sets the type toast notification.
notificationAction string Not-functional Set onClick function of notification.
theme string Not-functional Set light or dark-mode.
animated bool Animates the icon of the notification.
autodelete bool int Deletes the component after setTimeout.

Custom notification variables

These paramaters set custom visual data on the notification component.

Parameter Type Description
title string Set the title of notification component.
message string Set the message to display in notification.
messageExtended bool Set the message to display in notification.
time date Set the time the notification was created.
icon string Set an icon from the ionic icon library.

Roadmap

Upcoming or planned functions and features to the library.

  • Improved responsive design

  • Angular and Vue support

  • Better documentation

Author

toast-ifications's People

Contributors

casm101 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.