@lucaleukert/expo-toast
v0.1.1
Published
Native-feeling liquid-glass toast notifications for Expo (iOS 26+)
Maintainers
Readme
expo-toast
Native-feeling liquid-glass toast notifications for Expo with an iOS-native presenter.
V1 scope
- iOS 15.1+ runtime support
- Imperative API (
toast.show,toast.success, ...) - Preset variants:
success | error | info | loading - Up to three visible toasts per edge + FIFO queue
- Global defaults (
toast.configure) - Promise helper (
toast.promise) - Dedupe window + queue drop policy controls
- Accessibility controls (
accessibilityLabel,announce,importance) - Reduced-motion aware animations (
motion: 'system' | 'full' | 'minimal') - Default position:
top - Default size:
fit-content(size: 'fill-width'also supported) - Default duration:
3000ms - Swipe-up dismiss + one optional action
- Unsupported platforms: no-op + one dev warning
Install
bun add expo-toastDocumentation
- Docs site:
https://lucaleukert.github.io/expo-toast/ - Source docs live in
docs/(Astro + Starlight) - Root
README.md,CHANGELOG.md, and public API JSDoc are synced into docs via:
bun run docs:syncPublishing (CI/CD)
This repository publishes to npm via GitHub Actions using npm Trusted Publishing (OIDC), not an npm token.
One-time setup:
- In npm package settings, add a Trusted Publisher for this GitHub repository and the workflow file:
.github/workflows/publish.yml. - Ensure the release is cut from the same repository configured in npm.
Then publish by creating a GitHub Release (published) or running the Publish npm Package workflow manually.
API
import { toast } from 'expo-toast';
toast.success('Saved');
const id = toast.loading('Syncing...');
toast.dismiss(id);Methods
toast.show(options): ToastIdtoast.success(message, options?)toast.error(message, options?)toast.info(message, options?)toast.loading(message, options?)toast.transition(id, options)toast.update(id, options)(alias fortransition)toast.promise(promise, messages, options?)toast.configure(config)toast.dismiss(id?)toast.dismissAll()toast.isSupported(): boolean
Queue controls
Use toast.configure to control queue behavior:
maxVisible: max simultaneously visible toasts per edgemaxQueue: max pending toasts per edgedropPolicy:'oldest' | 'newest'when pending queue is full
Compatibility
- Expo SDK: tested on
54.x - React Native: tested on
0.81.x - iOS runtime: supported on
15.1+(native presenter; liquid-glass styling on iOS 26+) - Android/Web: API is safe no-op,
toast.isSupported()returnsfalse
Build module
bun install
bun run buildRun example app (uses local module)
cd example
bun install
bun run prebuild
bun run iosbun run ios uses expo run:ios --device and targets your connected iPhone.
For JS-only iteration:
bun run startRepository scripts
bun run buildbuilds module typings + JS outputbun run docs:syncsyncs README/CHANGELOG + generated JSDoc API docs into docs reference pagesbun run docs:check-syncverifies docs references are in syncbun run docs:devruns the Astro docs site locallybun run docs:buildbuilds the Astro docs sitebun run lintruns Biome lint checksbun run formatformats code with Biomebun run format:checkchecks formatting with Biomebun run lint:exporuns Expo module lint checksbun run example:startstarts the example appbun run example:prebuildprebuilds the example native projectsbun run example:iosruns the example on a connected iPhone (--device)bun run example:devicealias for the same device command
