Skip to content
wyllet
  • Docs
  • Features
  • Playground
  • Blog
  • Docs
  • Features
  • Playground
  • Blog
  • Compare
  • Changelog
GitHub @wylletdevnpm Support
esc
  • IntroductionWhat Wyllet is, what it includes, and how it fits into a wagmi + viem dApp.
  • InstallationInstall Wyllet and its peer dependencies, and enable WalletConnect.
  • Quick startAdd a working connect button to a React dApp in a few minutes.
  • Next.jsUse Wyllet with the Next.js App Router, server components and SSR.
  • Build with AI assistantsGive Cursor, Claude Code, Copilot or ChatGPT the Wyllet docs and the rules for a correct integration.
  • ConfigurationCreate a wagmi config with getDefaultConfig: app info, chains, transports and wallets.
  • WylletProviderEvery WylletProvider prop: theme, appearance, tokens, auth, messages and callbacks.
  • WylletButtonThe Island button, its display options, and building your own trigger with useWylletButton.
Overview

Getting started

  • Introduction
  • Installation
  • Quick start
  • Next.js
  • Build with AI assistants

Core concepts

  • Configuration
  • WylletProvider
  • WylletButton
  • Presentations

Customization

  • Theming
  • Class names
  • Translations

Wallets

  • Wallets
  • All wallets
  • WalletConnect

Chains and tokens

  • Chains
  • Tokens

Features

  • Account panel
  • Activity and transactions
  • Toasts
  • Sign-In With Ethereum
  • ConnectGate

Reference

  • Hooks
  • Components
  • Utilities and types

Guides

  • Security
  • Migrate from RainbowKit
  • FAQ
wyllet

The open-source wallet connector for React dApps. Built on wagmi and viem.

MIT licensed. v1.1.0 on npm with provenance.

Product

  • Features
  • Compare
  • Playground
  • Changelog
  • Blog

Docs

  • Quick start
  • Next.js
  • Build with AI
  • Theming
  • Migrate from RainbowKit

Community

  • GitHub
  • X @wylletdev
  • npm
  • Releases
  • Report an issue

Support

  • support@wyllet.dev
  • FAQ
  • Security
  • Report a vulnerability
  • MIT License

For AI agents

  • llms.txt
  • llms-full.txt
  • RSS feed
  • Sitemap

Wallet, network and token names and logos are trademarks of their respective owners and are used only to identify them.

Docs/Features

Toasts

Themed, promise-aware notifications with useWylletToast.

View .mdReport a problem

Wyllet includes a themed toast system. It is the same one used for transaction updates, so your own notifications match. Toasts render in a portal at the edge of the screen and follow your theme.

import { useWylletToast } from 'wyllet'
 
function SaveButton() {
  const toast = useWylletToast()
  return <button onClick={() => toast.success('Saved', { description: 'Your settings were updated.' })}>Save</button>
}

The toast API

useWylletToast() returns a function with helper methods attached.

CallReturnsDescription
toast(options)stringShow a toast with full ToastOptions. Returns its id
toast.success(title, options?)stringSuccess toast
toast.error(title, options?)stringError toast
toast.loading(title, options?)stringLoading toast with a spinner. It stays until you update or dismiss it
toast.update(id, options)voidChange an existing toast in place. Does nothing if the id is not showing
toast.dismiss(id?)voidDismiss one toast, or all toasts when called without an id
toast.promise(promise, messages)PromiseLoading toast that turns into success or error with the promise

The helpers take the same options as toast(), without title and status.

Promises

toast.promise shows messages.loading until the promise settles, then replaces it with messages.success or messages.error. Both can be functions that receive the resolved value or the error. It returns the promise's value, and rethrows its error, so you can keep using the result.

const receipt = await toast.promise(bridge(amount), {
  loading: 'Bridging to Base...',
  success: (r) => `Bridged ${r.amount} ETH`,
  error: (e) => (e instanceof Error ? e.message : 'Bridge failed'),
})

Updating a toast

Pass an id to reuse a toast instead of stacking a new one. Calling toast() with an id that is already showing updates it.

const id = toast.loading('Uploading...')
try {
  await upload(file)
  toast.update(id, { status: 'success', title: 'Uploaded' })
} catch {
  toast.update(id, { status: 'error', title: 'Upload failed' })
}

ToastOptions

FieldTypeDefaultDescription
titleReactNodeMain text. Required for toast()
descriptionReactNodeSecondary text
status'info' | 'success' | 'error' | 'loading''info'Icon and color
durationnumber4500, or 7000 for errorsMilliseconds before it closes. Infinity keeps it open
action{ label: ReactNode; href?: string; onClick?: () => void }A button, or a link when href is set
idstringGeneratedReuse an id to update a toast in place

Loading toasts never close on their own, whatever the duration. Every toast has a close button. An action with href opens in a new tab.

toast({
  status: 'success',
  title: 'Order filled',
  description: '2.4 ETH at 3,120 USDC',
  action: { label: 'View', href: 'https://basescan.org/tx/0x...' },
  duration: 10_000,
})

At most six toasts are kept at once. Showing a seventh drops the oldest.

Position

Set appearance.toastPosition:

<WylletProvider appearance={{ toastPosition: 'bottom-right' }}>
  {children}
</WylletProvider>
ValueNotes
'top-center'Default
'top-left', 'top-right'Top corners
'bottom-left', 'bottom-center', 'bottom-right'Bottom edge

Styling

Add your own classes to every toast with the toast slot:

<WylletProvider classNames={{ toast: 'shadow-xl' }}>
  {children}
</WylletProvider>

Toasts respect appearance.disableAnimations and the user's reduced-motion setting. Error toasts are announced to screen readers as alerts, and the rest as status messages. See Class names and Theming for more.

PreviousActivity and transactionsNextSign-In With Ethereum

On this page

  • The toast API
  • Promises
  • Updating a toast
  • ToastOptions
  • Position
  • Styling