@bimetal/toast-react-components
v0.37.0
Published
Default React toast viewport — queue, auto-dismiss, pause-on-hover, variants, positioning, a11y. A thin binding over the canonical toast controller. No domain dependency (no calendar, no undo/redo).
Maintainers
Readme
@bimetal/toast-react-components
The React toast viewport — the BIMETAL component family's lightweight / feedback
member. A thin binding over the canonical @bimetal/toast-headless controller (queue,
auto-dismiss, pause-on-hover, variants, positioning, a11y). No domain dependency.
import { useToastController } from '@bimetal/react';
import { ToastViewport } from '@bimetal/toast-react-components';
import '@bimetal/toast-react-components/styles';
function App() {
const [, toasts] = useToastController({ config: { position: 'bottom-end' } });
return (
<>
<button onClick={() => toasts.push({ message: 'Gespeichert', variant: 'success' })}>Save</button>
<ToastViewport controller={toasts} />
</>
);
}The app decides the message and calls toasts.push(...); the viewport renders the stack.
Bound-only: you own the controller (it is what you push to).
