WP Tosuto — Documentation
WP Tosuto is a WordPress plugin that renders programmatic toast notifications via the WordPress Interactivity API, inspired by shadcn/ui.
Contents
- PHP API — public functions, classes, and hooks for server-side use
- JavaScript / TypeScript API — Interactivity API store, actions, types, and value objects
Quick Start
Server side
// Add a success toast from any PHP context
wp_tosuto( 'Settings saved!', [
'variant' => 'success',
'duration' => 3000,
'dismissable' => true,
] );
Client side
import { store } from '@wordpress/interactivity';
const { actions } = store( 'wp-tosuto' );
actions.add( 'File uploaded successfully!', {
variant: 'success',
duration: 4000,
dismissable: true,
} );