@hudoro/toast
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-beta.8 • Public • Published

Hudoro toast

Hudoro toast is a strict and customizable toast component for web development projects, designed for simplicity and adherence to strict design guidelines.

Screenshots

App Screenshot

Package instalation

Instal package using pnpm

  pnpm add @hudoro/toast

Instal package using yarn

  yarn add @hudoro/toast

Instal package using npm

  npm i @hudoro/toast

Usage/Examples

import React from "react";
import {ToastContainer, toast} from "@hudoro/toast";
import ReactDOM from "react-dom/client";

const App = () => {
  const handleAddToastSuccess = () => {
    toast.success("New Feature Available success");
  };
  const handleAddToastDefault = () => {
    toast.default("New Feature Available default");
  };
  const handleAddToastInfo = () => {
    toast.info("New Feature Available info");
  };
  const handleAddToastDanger = () => {
    toast.danger("New Feature Available danger");
  };
  return (
    <div>
      <button onClick={handleAddToastSuccess}>success</button>
      <button onClick={handleAddToastDefault}>default</button>
      <button onClick={handleAddToastInfo}>info</button>
      <button onClick={handleAddToastDanger}>danger</button>
      <ToastContainer type="outline" direction="bottom-right" />
    </div>
  );
};

ReactDOM.createRoot(document.getElementById("app")!).render(<App />);

Props

Props that you can pass to <ToastContainer {...props} />

Prop Name Value required
type "solid" / "outline" false
direction "bottom-right" / "bottom-left" / "top-right" / "top-left" false

Readme

Keywords

none

Package Sidebar

Install

npm i @hudoro/toast

Weekly Downloads

427

Version

0.0.1-beta.8

License

ISC

Unpacked Size

62.7 kB

Total Files

8

Last publish

Collaborators

  • muhfikri4
  • dani_ganteng
  • prawitohudoro