@remcostoeten/notifier
Notifications with a fluent API.
A lightweight, chainable React notification system for useful feedback: status changes, async work, confirmations, and errors that need a clear next state.
What it replaces
Use Notifier when a product action needs compact, visible feedback without turning every mutation into its own modal state machine. Especially useful for saves, imports, background work, and destructive confirmation.
Quick start
1import { Notifier, notify } from '@remcostoeten/notifier'23export function App() {4 return <Notifier position="bottom-right" />5}67const notice = notify.loading('Saving settings…')8saveSettings().then(() => notice.success('Settings saved'))Integration shape
Render Notifier near app root.
Create loading or informational notice at action boundary.
Promote same notice to success or error after work completes.
API examples
Use a direct call when the next state is already known.
1notify.success('Settings saved')Keep one notice and promote it when the request finishes.
1const notice = notify.loading('Saving settings…')23saveSettings().then(() => notice.success('Settings saved'))Use the promise helper when loading, success, and error all follow the request.
1notify.promise(saveSettings(), {2 loading: 'Saving settings…',3 success: 'Settings saved',4 error: 'Could not save settings'5})<Notifier position="bottom-right" options={options} />positionWhere the notification region is mounted: top, bottom, left, or right variants.optionsOptional defaults for duration, visible count, theme, radius, icons, and swipe behavior.notify.promise(task, messages, options?)taskThe promise that controls the notification lifecycle.messages.loadingText shown while the promise is pending.messages.success / errorText shown when the promise resolves or rejects.await notify.confirm(options)options.titleThe confirmation heading.options.descriptionThe context for the action the user is about to confirm.options.confirmLabelOptional label for the confirm action.