# ultimate-store-kit/3.1.0/src/admin/components/Toast.js

Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder, version 3.1.0. 33 lines.

- Page: https://pluginprobe.com/plugins/ultimate-store-kit/3.1.0/code/src/admin/components/Toast.js
- Raw: https://pluginprobe.com/plugins/ultimate-store-kit/3.1.0/raw/src/admin/components/Toast.js
- Modified: 2026-08-17T09:34:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ultimate-store-kit/3.1.0/code/src/admin/components/Toast.js#L10-L20`.

```javascript
import { createPortal } from '@wordpress/element';

/**
 * Fixed top-center toast notification.
 *
 * @param {{ notification: { type: string, message: string } | null, onDismiss: () => void }} props
 */
const Toast = ({ notification, onDismiss }) => {
	if (!notification) return null;

	const typeClass = notification.type === 'success'
		? 'usk-toast--success'
		: 'usk-toast--error';

	return createPortal(
		<div className="usk-toast-wrap">
			<div className={`usk-toast ${typeClass}`}>
				<span>{notification.message}</span>
				<button
					type="button"
					className="usk-toast__close"
					onClick={onDismiss}
				>
					&times;
				</button>
			</div>
		</div>,
		document.body
	);
};

export default Toast;

```
