Getting Started
Install
pnpm add @khencahyo13/notifin-react
# atau npm i @khencahyo13/notifin-react
# atau yarn add @khencahyo13/notifin-reactPeer dependency:
react >= 18react-dom >= 18
1) Mount Host Sekali di Root
<Notifin /> harus dimount agar semua pemanggilan API notifin.* bisa dirender.
import { Notifin } from "@khencahyo13/notifin-react";
export default function AppLayout() {
return (
<>
<Notifin />
{/* your app */}
</>
);
}2) Trigger Notification dari Mana Saja
import { notifin } from "@khencahyo13/notifin-react";
notifin("Saved draft");
notifin.success("Profile updated");
notifin.error("Upload failed", {
description: "Please retry in a few seconds.",
});3) Pahami Perilaku Dasar
- Dialog ditampilkan satu per satu (queued).
- Memanggil API saat host belum dimount akan melempar error.
- Style sudah diinject otomatis saat import package.
Lanjut ke Basic Usage.
Last updated on