Browse docsToast

Feedback

Glass Toast

A glass notification for brief updates, announced to screen readers.

pnpm dlx shadcn@4.14.1 add @glassyui/glass-toast

Preview

Demos ready. Update 0.

Installation

First add the exact @glassyui mapping to components.json as shown in Getting Started. Then run the pinned item command:

Install Glass Toast

pnpm dlx shadcn@4.14.1 add @glassyui/glass-toast
What this installs11 files, 2 packages

Direct registry declarations

These values belong to @glassyui/glass-toast itself in registry.json.

Package dependencies

  • @radix-ui/react-toast
  • clsx

Registry dependencies

  • @glassyui/glass-panel

File targets

  • components/glassyui/glass-toast.tsx

Complete installed closure

This follows every namespaced registry dependency recursively and de-duplicates the packages and target files installed with this item.

Package dependencies

  • @radix-ui/react-toast
  • clsx

Installed files

  • components/glassyui/glass-toast.tsx
  • components/glassyui/glass-panel.tsx
  • components/glassyui/glass-surface.tsx
  • components/glassyui/lib/merge-refs.ts
  • components/glassyui/lib/refraction-map.ts
  • components/glassyui/lib/use-refraction-filter.tsx
  • components/glassyui/lib/scene-context.ts
  • components/glassyui/glass-provider.tsx
  • components/glassyui/liquid-filters.tsx
  • components/glassyui/lib/preferences.ts
  • components/glassyui/styles/liquid.css

Usage

Usage

import { GlassToast, GlassToastDescription, GlassToastProvider, GlassToastTitle, GlassToastViewport } from "@/components/glassyui/glass-toast";

export function ToastDemo() {
  return (
    <GlassToastProvider>
      <GlassToast open>
        <GlassToastTitle>Saved</GlassToastTitle>
        <GlassToastDescription>Your changes are stored.</GlassToastDescription>
      </GlassToast>
      <GlassToastViewport />
    </GlassToastProvider>
  );
}

Examples

A dismiss button

<GlassToast>
  <GlassToastTitle>Saved</GlassToastTitle>
  <GlassToastDescription>Your changes are stored.</GlassToastDescription>
  <GlassToastClose />
</GlassToast>
An action

<GlassToast>
  <GlassToastTitle>Message deleted</GlassToastTitle>
  <GlassToastAction altText="Undo the delete" onClick={undo}>
    Undo
  </GlassToastAction>
</GlassToast>

API

GlassToastProvider

Radix Toast provider.

GlassToast

Glass panel toast root.

GlassToastViewport

Fixed viewport for toast placement.

GlassToastTitle

Styled Radix toast title.

GlassToastDescription

Styled Radix toast description.

GlassToastClose

A round dismiss button that draws its own ×. Named "Dismiss" unless you pass aria-label.

GlassToastAction

A pill under the message, such as Undo. altText says how to do it without the button.

Notes

Motion

A toast slides in from the side its swipe direction points to (the right unless the provider's swipeDirection says otherwise) and back out when it closes. Drag it that way to dismiss it: a short drag springs back and a fling sends it away. Reduced motion shows and hides it at once.

Accessibility

Keep the Radix-backed semantics intact and preserve visible labels, focus states, and keyboard operation when copying the source.

Performance

Use provider quality preferences for dense app screens. Reserve strong refraction for hero or showcase surfaces.