BetaPublic beta — Read the release notes
Documentation

Toast

Temporary non-blocking notification.

Package
@solidiom/toast
Version
0.0.1-next.0
Status
stable

Generated from the package's public source.

API

Closecomponent

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

                        Close(props: ToastCloseProps): Element
                      

Props

class?
string
toastId?
string — Toast id to dismiss. If omitted, reads from nearest Root's data-toast-id.

children: Element

View source

createToasterfunction

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

                        createToaster(options: ToasterOptions): ToasterApi
                      

View source

Descriptioncomponent

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

                        Description(props: ToastDescriptionProps): Element
                      

Props

class?
string

children: Element

View source

Regioncomponent

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

                        Region(props: ToastRegionProps): Element
                      

Props

label?
string — Custom aria-label. Default: "Notifications".
toaster
ToasterApi — Toaster API from createToaster().

children: Element | (toasts: () => ToastEntry[]) => Element

View source

Rootcomponent

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

                        Root(props: ToastRootProps): Element
                      

Props

class?
string
style?
string | CSSProperties
toastId
string — Toast entry id for dismissal.

children: Element

View source

Titlecomponent

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

                        Title(props: ToastTitleProps): Element
                      

Props

class?
string

children: Element

View source

ToastClosePropsinterface

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

Props

class?
string
toastId?
string — Toast id to dismiss. If omitted, reads from nearest Root's data-toast-id.

children: Element

View source

ToastContextValueinterface

Props

dismiss
(id: string) => void — Dismiss a toast by id.
pause
() => void — Pause all auto-dismiss timers (hover).
paused
Accessor<boolean> — Whether timers are paused.
resume
() => void — Resume all auto-dismiss timers.
toasts
Accessor<ToastEntry[]> — Currently visible toasts (FIFO, capped by max).

View source

ToastDescriptionPropsinterface

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

Props

class?
string

children: Element

View source

ToastEntryinterface

Props

description?
string — Optional description body.
duration
number — Auto-dismiss duration in ms. 0 disables auto-dismiss.
id
string — Unique identifier.
onDismiss?
() => void — Called when the toast is dismissed.
title
string — Toast title text.

View source

ToasterApiinterface

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

Props

dismiss
(id: string) => void — Dismiss a toast by id.
toast
(entry: Omit<ToastEntry, "id" | "duration"> & { … }) => string — Add a toast to the queue. Returns the toast id.
toasts
() => ToastEntry[] — Reactive accessor to the current toast list.

View source

ToasterOptionsinterface

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

Props

defaultDuration?
number — Default duration in ms. Default: 5000.
max?
number — Maximum visible toasts. Default: 3.

View source

ToastRegionPropsinterface

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

Props

label?
string — Custom aria-label. Default: "Notifications".
toaster
ToasterApi — Toaster API from createToaster().

children: Element | (toasts: () => ToastEntry[]) => Element

View source

ToastRootPropsinterface

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

Props

class?
string
style?
string | CSSProperties
toastId
string — Toast entry id for dismissal.

children: Element

View source

ToastTitlePropsinterface

@solidiom/toast — Headless toast notification primitive. Parts: Region, Root, Title, Description, Close. API: createToaster() for programmatic queue control.

Props

class?
string

children: Element

View source