Getting Started

Welcome to the Toastex documentation! Toastex is a robust, enterprise-standard, and highly customizable vanilla JS/TS toast notification library with zero dependencies.

Installation

Install Toastex via your preferred package manager:

bash
npm install toastex
bash
pnpm add toastex
bash
yarn add toastex

Basic Usage

Toastex automatically handles DOM injection, so you don't need to wrap your application in a massive Context Provider. Just import it and call it anywhere.

typescript
import { Toastex } from 'toastex';
import 'toastex/toastex.css'; // Important: Import the core styles

// Trigger a success toast
Toastex.success('Data saved successfully!');

// Trigger an error toast with options
Toastex.error('Connection failed', {
  variant: 'swift',
  theme: 'dark',
  position: 'top-right'
});