Install iziToast for Ruby on Rails
masterFor Ruby on Rails integration, use the iziToast-rails GEM available on GitHub.
https://github.com/BadAllOff/iziToast-railsrepository·master·Indexed 25 days ago
https://github.com/marcelodolza/izitoastA lightweight, responsive, and flexible notification plugin with no dependencies. Version 1.5.0 features theme methods for info, success, warning, error, and question notifications, customizable positions, and support for wrappers in Angular 2 and Vue 2. Includes APIs for global settings, lifecycle callbacks, and progress bar control.
For Ruby on Rails integration, use the iziToast-rails GEM available on GitHub.
https://github.com/BadAllOff/iziToast-railsYou can install the core iziToast library using your preferred package manager.
# NPM
npm install izitoast --save
# Yarn
yarn add izitoast --save
# Bower
bower install izitoast --saveTo use iziToast within a Vue 2 application, install the vue-izitoast wrapper using NPM or Yarn.
# NPM
npm install vue-izitoast --save
# Yarn
yarn add vue-izitoastTo use iziToast within an Angular 2 application, install the ng2-izitoast wrapper.
npm install ng2-izitoast --save$iziToast.destroy() to remove all active toast wrappers, overlays, and instances from the DOM and reset the library state.You can interact with the settings of a specific, already-rendered toast instance using its reference.
$iziToast.setSetting(ref, option, value): Updates a specific option for a toast identified by ref.$iziToast.getSettings(ref, option): Retrieves a specific option or the entire settings object for a toast identified by ref.$iziToast.settings(options) to configure the global default settings for all subsequent toast notifications. Calling this method will destroy any existing initializations before applying the new configuration.For toasts with a progress bar, you can control the timer using the .progress() method on the iziToast instance. This returns an object with the following methods:
start(): Starts or resumes the progress bar timer.pause(): Pauses the progress bar timer.resume(): Resumes the progress bar timer.reset(): Resets the progress bar to 100% and clears the timer.iziToast provides shorthand methods for common notification types. These methods automatically apply theme-specific colors and icons. The available theme methods are:
iziToast.info(options)iziToast.success(options)iziToast.warning(options)iziToast.error(options)iziToast.question(options)When calling a theme method (like iziToast.success()), you can pass an options object to customize the toast.
Common Options:
id: Custom string ID for the toast.title: The text for the title.message: The text for the message.position: 'bottomRight', 'bottomLeft', 'bottomCenter', 'topRight', 'topLeft', 'topCenter', or 'center'.theme: 'light' or 'dark'.color: Custom color (hex, rgb, hsl) or theme color (e.g., 'blue', 'red', 'green', 'yellow').timeout: Duration in milliseconds before the toast closes (default: 5000).close: Boolean to show/hide the close button (default: true).progressBar: Boolean to show a progress bar (default: true).transitionIn: Animation for entering (e.g., 'fadeInUp', 'bounceInLeft').transitionOut: Animation for exiting (e.g., 'fadeOut').overlay: Boolean to show a background overlay (default: false).buttons: Array of arrays defining buttons: ['Label', callback, focus_boolean].inputs: Array of arrays defining inputs: [input_config, event_type, callback, focus_boolean].onOpening, onOpened, onClosing, onClosed: Lifecycle callback functions.