App
@rockshin/tao-uiProvides scoped message, notification and modal instances with application context.
When to use
Wrap the consuming subtree with App, then call App.useApp() inside a descendant. Put TaoProvider and any custom context providers outside App so feedback content inherits them. Each example has an isolated preview.
Examples
Scoped messages
The hook must run below App. Each instance owns its messages and can destroy only its own notices.
Keyed updates and close promises
A message result is both a close function and a thenable. Reusing key updates the existing message.
Notifications with actions and progress
duration is measured in seconds. showProgress visualizes the auto-close timer; hovering pauses it by default.
Await a confirmation
The result resolves to true for confirmation and false for cancellation. This demo changes local state only.
Async confirmation and retry
Returning a promise keeps the action busy. Rejection keeps the modal open. This local simulation deliberately fails once, then succeeds.
Update and destroy a modal
The returned handle updates content or closes the dialog. A custom footer can retain the supplied OkBtn and CancelBtn.
Theme, locale and custom context
Feedback portals retain provider tokens and React context. Locale supplies default confirmation and close labels.
Independent scopes and custom roots
Two App instances keep separate message stores. component changes the wrapper element; component= omits only that wrapper.