Socket
Socket
Sign inDemoInstall

toaststrap

Package Overview
Dependencies
3
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    toaststrap

A javaScript library for simple, lightweight toast popups. Uses Bootstrap 5 styles.


Version published
Maintainers
1
Install size
4.97 MB
Created

Changelog

Source

[1.0.0-beta-1] - 2021-11-01

First released.

Readme

Source

Toastsrap

Toaststrap is a javascript library for simple, lightweight toast popups. It uses bootstrap 5 styles.

العربية

Preview

I created this library for everyone who use Bootstrap5 and want to show some beautiful notifications for his users.

Features

  • Pure JavaScript without jQuery.
  • 🇸🇦 RTL support.
  • Easy to initialize and use.
  • 🆙 Support sound.
  • Quick and efficient.
  • 🎨 Customizable.
  • 🆙 Maintainable and up-to-date.

Documentation

Using in browser

  1. Download dist folder from this repository.
  2. Be sure you are using the latest bootstrap 5.

Example

<!DOCTYPE html>

<!-- To use RTL, add dir="rtl" attribute to <html> tag. -->
<html>
<head>
  <link href="bootstrap/bootstrap.min.css" rel="stylesheet" media="all "/>
  <link href="toastsrap/toastsrap.css" rel="stylesheet" media="all "/>
</head>

<body>

<script src="toastsrap/toastsrap.js"></script>
<script>
  var toast = Toastsrap.initialize({
    title: 'Greeting',
    text: 'Hello World',
    type: window.toastsrap_type.INFO,
    position: window.toastsrap_position.BOTTOM_START
  });
  
  toast.show();
</script>
</body>
</html>

Using with react

npm install toaststrap

Example

import Toast, {ToastType, ToastPosition} from 'toastsrap';

// Load Styles
import 'toastsrap/dist/bootstrap5-toast.css'

const MyToastComponent = () => {
  const handleOnClick = () => {
    const toast = Toast.initialize({
      title: 'Greeting!',
      text: 'Hello World',
      position: ToastPosition.TOP_END,
      type: ToastType.PRIMARY
    })
    
    toast.show()
  }
  return (<button onClick={handleOnClick}>Click Me</button>)
}

Setup development environment

  1. Clone the project
git clone https://github.com/nawafscript/toastsrap.git
  1. Install packages
npm install
  1. Start development server
npm run dev

Be a sponsor

Bugs and feature requests

Found a bug or have a feature request? Please open a new issue

Keywords

FAQs

Last updated on 04 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc