1.0.7 • Published 11 months ago

toastam v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Toastam

Toastam is a lightweight, customizable toast library for React applications. It offers an intuitive API for triggering toast messages with flexible styling and positioning options.

npm version license

Features

  • Lightweight and easy to integrate
  • Customizable toast messages
  • Multiple style variants
  • Flexible positioning
  • Adjustable duration
  • TypeScript support

Installation

Install Toastam using npm:

npm install toastam

Quick Start

  1. Import the necessary components:
import { Toaster, toast } from "toastam";
  1. Add the Toaster component to your app's root:
function App() {
  return (
    <div className="App">
      {/* Your app components */}
      <Toaster />
    </div>
  );
}
  1. Trigger toast messages anywhere in your application:
toast.success("Operation completed successfully!");

API Reference

Toaster Component

PropTypeDefaultDescription
styleVariant'normal' \| 'sharp''normal'Visual style of toast messages
durationnumber3000Display duration (ms)
position'top-left' \| 'top-center' \| 'top-right' \| 'bottom-left' \| 'bottom-center' \| 'bottom-right''top-right'Toast container position

Toast Functions

  • toast.success(message: string)
  • toast.error(message: string)
  • toast.warning(message: string)
  • toast.info(message: string)

Examples

toast.success("Profile updated successfully!");
toast.error("An error occurred. Please try again.");
toast.warning("Your session is about to expire.");
toast.info("New app version available.");

Documentation

For detailed usage instructions, advanced customization options, and API documentation, visit our official documentation.

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

Toastam is MIT licensed.

Links

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago