Basic Usage
Tipe Notification
Notifin punya 6 tipe:
defaultsuccesserrorwarninginfoloading
Contoh:
import { notifin } from "@khencahyo13/notifin-react";
notifin("Default message");
notifin.success("Data tersimpan");
notifin.error("Request gagal");
notifin.warning("Aksi ini berisiko");
notifin.info("Ada update baru");
notifin.loading("Mempersiapkan proses...");Dengan Deskripsi
notifin.info("Maintenance malam ini", {
description: "Layanan akan restart pukul 23:00 WIB.",
});Dengan Tombol Action dan Cancel
notifin.warning("Hapus item ini?", {
description: "Aksi ini tidak bisa dibatalkan.",
action: {
label: "Hapus",
onClick: () => {
console.log("hapus");
},
},
cancel: {
label: "Batal",
},
});Auto Dismiss
notifin.success("Berhasil disimpan", {
duration: 2000,
});Jika duration tidak diisi, dialog tidak auto-close.
Lanjut ke Notifin Component dan Show Options.
Last updated on