Design-system-first toast notifications.
twist-toast is an open-source library focused on one principle: you own every pixel of the toast UI, while the library manages behavior (state, queueing, timing, lifecycle, and accessibility).
Most toast libraries bundle UI opinions that are hard to align with product design systems.
twist-toast separates concerns:
- Your components define presentation
- The library handles behavior and orchestration
- TypeScript infers payload types from your component map
The primary integration model is:
- Define your toast components
- Call
createToast(components, options?) - Use a zero-config
<ToastProvider>in your app root
This keeps configuration close to your component definitions and gives strongly typed toast.success(...), toast.error(...), and custom variant methods.
createToast()factory with type inference- Queue management with configurable max visible toasts
- Deduplication by toast
id(ignore/refresh behavior) - Programmatic dismissal:
dismiss(id)anddismissAll() - Per-toast options:
duration,position,dismissOnClick,id,role - Accessibility defaults (
alert/status, non-focus-stealing behavior) - Multiple isolated toast instances in a single app
Main deliverable - the core toast notification library:
createToast()factory with full TypeScript inferenceToastProvidercomponent for React integration- Queue management, deduplication, and lifecycle control
- Zero runtime dependencies beyond React
- Complete behavior management (state, timing, accessibility)
Shared ESLint configurations:
@twist-toast/eslint-config/base- Base rules@twist-toast/eslint-config/next-js- Next.js specific@twist-toast/eslint-config/react-internal- React library rules
Shared TypeScript configurations:
base.json- Base config with strict modenextjs.json- Next.js specificreact-library.json- React library specific
Documentation and landing page (Next.js):
- Product showcase and feature highlights
- API documentation and usage guides
- Interactive examples and demos
twist-toast/
├── apps/
│ └── www/ # Documentation site
├── packages/
│ └── core/ # Main library
├── tooling/
│ ├── eslint-config/ # Shared linting
│ └── typescript-config/# Shared TS configs
├── tutorials/ # Guides and tutorials
├── AGENTS.md # AI assistant guidance
└── .turbo/ # Turborepo cache
This repository is currently under active development.
packages/core is the main deliverable containing the complete React toast library with TypeScript-first design.
- Node.js 18+
- pnpm 10+
pnpm installpnpm buildpnpm --filter twist-toast build
pnpm --filter @twist-toast/www buildpnpm lint
pnpm format
pnpm check-types# Add core library to your app
pnpm add twist-toast@workspace:*
# Add shared configs to packages
pnpm add -D @twist-toast/eslint-config@workspace:*
pnpm add -D @twist-toast/typescript-config@workspace:*- Phase 1 (Current): React 17+ support with TypeScript generics, comprehensive testing, and npm publication
- Phase 2: CLI tooling for scaffolding and component generation
- Phase 3+: Multi-framework support (Vue, Angular, Svelte)
- AI assistant guidance and project structure:
AGENTS.md - Tutorials and guides:
tutorials/
MIT