React

Shared React 19 + Inertia v3 + Tailwind CSS v4 runtime, admin shell, form controls, rich text editor, vector icons, and interactive data viewports for ProcessWire.

React for ProcessWire

PHP 8.4+ ProcessWire 3.0.271+ React 19 Inertia v3 Tailwind CSS v4 License: MIT

A shared React 19, Inertia.js v3, and Tailwind CSS v4 UI runtime for ProcessWire 3. Build dual-context admin workspaces, interactive data tables and cards, modern media and relational fields, rich text editing, and vector icon pickers without duplicating frontend infrastructure across modules.

Quick Start · What's Included · Configuration · Documentation · API Reference

React for ProcessWire preview

[!NOTE] Installing React adds zero top-level admin menu items. An Admin > Workspace launcher appears only when you also install the optional ProcessReactWorkspace module.


At a Glance


  • Shared Modern UI Runtime: Ships React 19, Inertia v3, and Tailwind CSS v4 with isolated dist/ bundles loaded strictly on demand.
  • Dual-Context Admin Workspaces: Author a ProcessReact module once and run it both inside native Setup > <Module> and full-screen in the optional Admin > Workspace hub with the collapsible Sidebar navigation shell.
  • Native Theme Alignment: Maps ProcessWire --pw-* admin color variables automatically, with built-in presets, dark mode, and custom CSS token overrides.
  • 15 Built-in UI Controls: Interactive tables and cards, Tiptap v3 rich text editor, media upload/crop studio, relational pickers, polymorphic links, condition builder, tabs, key-value, and 6,545 vector icons.
  • Zero-Cost Lazy Extensions: Downstream modules register workspaces, data providers, command search sources, and controls on demand with zero overhead on unrelated requests.
  • Hardened & Localized: Enforces CSRF checks, user-bound HMAC-SHA256 tokens, strict JSON payload bounds, and 6 built-in language packs (en, tr, de, fr, es, ru).

How It Works


flowchart LR
    PW["ProcessWire Admin & Templates"] --> CORE["React Runtime & Theme Tokens"]
    CORE --> WS["Admin Workspaces (ProcessReact)"]
    CORE --> VP["Interactive Viewports (Table & Cards)"]
    CORE --> IF["Modern Inputfields (Tiptap, Media, Relations, Icons)"]
    WS --> DIST["Isolated On-Demand dist/ Bundles"]
    VP --> DIST
    IF --> DIST

Requirements & Installation


  • PHP: >= 8.4
  • ProcessWire: >= 3.0.271
  • Required Module: Inertia (Totoglu\Inertia)
composer require trk/processwire-react
php vendor/bin/wire module:install --name=React --json

# Optional: add the unified Admin > Workspace hub and cross-module switcher
php vendor/bin/wire module:install --name=ProcessReactWorkspace --json

What's Included


Installing React automatically installs 15 companion modules (ProcessReactWorkspace remains optional):

CategoryCompanion ModulesWhat It ProvidesGuide
Data ViewportsMarkupReactTable, MarkupReactCardsSortable, filterable, inline-editable table and responsive card viewports.04 — Viewports
Rich TextInputfieldTiptap, TextformatterTiptapMiniBlocksTiptap v3 rich text editor with native ProcessWire link/image modals and flat mini-blocks.03 — Tiptap
Media StudioInputfieldReactImage, InputfieldReactFileDropzone upload studio with crop/focus/rotate/flip tools, palette inspection, and multi-language metadata.03 — Media Studio
Relational PickersInputfieldReactM2O, M2M, O2M, M2AAsync search and tree pickers backed by 8 core ProcessWire resource adapters and custom adapters.03 — Relations
Form & Rule ControlsMarkupReactTab, InputfieldReactKeyValue, InputfieldReactLink, InputfieldReactConditionAccessible tabs, key-value pairs, polymorphic link picker, and visual AND/OR/NOT condition rule builder.03 — Controls
Vector IconsInputfieldReactIconSearchable 6,545-variant vector icon picker (outline and filled) plus admin template/field icons.03 — Vector Icons

Quick Start


1. Build a Dual-Context Admin Module

Extend ProcessReact to render a single React view inside Setup > Catalog and full-screen inside Admin > Workspace (?ws=1). See 02 — Workspaces & Admin Shell for layout and navigation options.

<?php

declare(strict_types=1);

namespace ProcessWire;

use Totoglu\React\Icon\IconManager;
use Totoglu\React\Inertia\ProcessReact;

class ProcessCatalog extends ProcessReact
{
	public function init(): void
	{
		parent::init();

		IconManager::registerAdminIcons(['layout-dashboard', 'shopping-bag']);

		React::deferModuleRegistration(
			$this,
			function (React $react): void {
				$react->workspaces()->register([
					'id' => 'catalog',
					'title' => $this->_('Catalog'),
					'description' => $this->_('Manage products, pricing tiers, and inventory.'),
					'icon' => 'shopping-bag',
					'process' => 'ProcessCatalog',
					'component' => 'Catalog/Workspace',
					'permission' => 'catalog-view',
				]);
			}
		);
	}

	/**
	 * @param array<string, mixed> $options
	 * @return string|array<string, mixed>
	 */
	public function ___executeNavJSON(array $options = []): string|array
	{
		if (!$this->wire()->user->hasPermission('catalog-view')) {
			throw new WirePermissionException($this->_('Access denied.'));
		}

		return $this->buildAdminNavJSON([
			['url' => '', 'label' => $this->_('Overview'), 'icon' => 'layout-dashboard'],
			['url' => 'products/', 'label' => $this->_('Products'), 'icon' => 'shopping-bag', 'separator' => true],
		], $options);
	}

	public function ___execute(): string
	{
		$react = React::instance($this);

		return (string) $this->inertiaRender('Catalog/Workspace', [
			'table' => $react->configureTable('pages:template=product, limit=25', [
				'title' => $this->_('Products'),
				'columns' => [
					'title' => $this->_('Title'),
					'modified' => $this->_('Modified'),
					'status' => $this->_('Status'),
				],
				'sortableColumns' => ['title', 'modified', 'status'],
				'quickEditEnabled' => true,
				'exportEnabled' => true,
			]),
		]);
	}
}

2. Render a Standalone Interactive Table

Embed an interactive table in any classic admin screen or frontend template (04 — Viewports & Data Providers):

<?php

declare(strict_types=1);

namespace ProcessWire;

$react = React::instance($this);

echo $react->renderTable('pages:template=basic-page, limit=20', [
	'title' => $this->_('Site Pages'),
	'columns' => [
		'title' => $this->_('Title'),
		'path' => $this->_('Path'),
		'modified' => $this->_('Modified'),
		'status' => $this->_('Status'),
	],
]);

3. Render Vector Icons in Templates

Attach InputfieldReactIcon to any FieldtypeText field or render icons directly via IconManager (03 — Vector Icons):

<?php

declare(strict_types=1);

namespace ProcessWire;

/** @var Page $page */
$icon = $page->hero_icon; // ReactIconValue when $page->of(true)
if (!$icon->isEmpty()) {
	echo $icon;
}

echo React::instance($this)->icons()->renderSvg('sparkles', [
	'variant' => 'filled',
	'size' => 24,
	'color' => '#0d9488',
]);

Configuration


Configure site-wide defaults under Modules > Configure > React (React.module.php):

SettingTypeDefaultDescription
defaultThemestring'system'Default color mode (system, light, or dark).
themePresetstring'native'Visual preset (native, neutral, slate, stone, ocean, indigo, teal, or custom).
themeCustomTokensstring''Sanitized :root and .dark CSS variables used when themePreset is custom.
enableKeyboardShortcutsbooltrueEnables Cmd/Ctrl+K command search, Cmd/Ctrl+B sidebar toggle, ? help, and save hotkeys.
adminReturnLabelstring'Panel'Localized top-left return label in Workspace mode.
useReactMediaFieldsboolfalseUpgrades standard page InputfieldImage and InputfieldFile fields to the React media studio.
enableAdminVectorIconsbooltrueAdds the vector icon picker on Edit Template and Edit Field screens.
adminIconPreviewSizeint28Preview icon size in pixels (16–64) in template and field editors.

[!TIP] Authenticated users can override theme mode, color preset, shell layout, and collapsed sidebar state from the Workspace account menu. See 02 — Centralized Theme Engine.


Extensibility & Gateways


Downstream modules integrate lazily via 'autoload' => false and 'reactCapabilities' => [...] pull-discovery, so unrelated requests pay zero boot cost. Client components communicate through eight authenticated /_react/* gateways.

Hookable methods & lazy registration helpers
  • Hookable React Methods: ___registerWorkspaces(), ___registerWidgets(), ___registerCommandSearch(), ___registerProviders(), ___registerRelationResources(), ___registerMediaHosts(), ___registerViewportModes(), ___registerLinkResolvers(), ___translations().
  • Deferred Helpers: React::deferModuleRegistration(), deferCommandSearchRegistration(), deferProviderRegistration(), deferRelationRegistration(), deferMediaHostRegistration(), deferViewportModeRegistration(), deferLinkResolverRegistration(), and React::forgetSharedViewportMode().
  • Rich Text Mini-Blocks: InputfieldTiptap::registerMiniBlocks for adding custom flat [data-tiptap-block] renderers under ./site/templates/tiptap/{name}.php.
  • Full Signatures: See API.md.
Internal HTTP gateways (/_react/*)

Registered in React.module.php:

EndpointPurpose
/_react/viewportSigned table/cards queries, inline edits, bulk actions, saved views, and exports.
/_react/workspace-prefsPer-user favorites, Bento grid layout, theme mode/preset, and shell layout preferences.
/_react/presenceConcurrent co-editor heartbeats and remote-save staleness warnings.
/_react/relationSigned relational search, tree loading, hydration, and O2M actions.
/_react/mediaSigned multipart uploads, replacements, image transforms, and palette inspection.
/_react/tiptapSigned page/file/anchor lookup and Pageimage upload/variation gateway.
/_react/iconsRead-only GET paginated icon search and hydration.
/_react/command-searchRead-only GET RBAC-scoped command palette search.

Documentation


What You Want to DoStart Here
Browse all guides by role or taskDocumentation Hub
Build a dual-context admin workspace or customize themes02 — Workspaces, Dual-Context Shell & Themes
Use Tiptap, Media Studio, Relations, Icons, Links, or SchemaForm03 — Inputfields, Forms & Rich Text
Render interactive tables, cards, or custom data providers04 — Viewports & Data Providers
Bundle downstream TypeScript with @pw/react/*, i18n, or audit security05 — Frontend Runtime, Typed SDK, i18n & Security
Understand system architecture, build pipeline, and ADRsArchitecture Overview · 01 — Deep-Dive
Look up exact PHP signatures, contracts, and dist/ bundlesAPI Reference
Review contributor invariants before editing React itselfAGENTS.md

Security & Verification


[!IMPORTANT] State-changing /_react/* requests require an authenticated user, $session->CSRF validation, POST enforcement, demo-mode checks, 2 MiB / depth-64 JSON limits, and user-bound HMAC-SHA256 signed tokens with 24-hour TTL. See 05 — Security Architecture.

Contributor verification commands

Run sequentially from the repository root:

composer --working-dir=site/modules/React validate --strict --no-check-publish --no-check-version
./vendor/bin/phpstan analyse -c site/modules/React/phpstan.neon --no-progress --memory-limit=1G
npm --prefix site/modules/React run build
npm --prefix site/modules/React run test:unit
php vendor/bin/wire test site/modules/React/tests --json
php vendor/bin/wire test:e2e --module=React --json
php vendor/bin/wire boost:validate --module=React --strict --json

More modules by Iskender TOTOGLU

  • FieldtypeFontIconPicker

    Module allow you to use Font-Awesome, Ionicons and other icon libraries easily. You can select icons directly from icon select list, also you can set settings for each InputfieldFontIconPicker.
  • WireMail: PHPMailer

    This module extends WireMail base class, integrating the PHPMailer mailing library into ProcessWire.
  • Mystique

    Mystique is a config file based field creation module for ProcessWire CMS/CMF by ALTI VE BIR.
  • Turkish (tr-TR)

    ProcessWire Türkçe Dil Çevirileri
  • Event Loader

    Event Loader module module allow you to load events from event files
  • HTMX

    Provides HTMX v2 integration including Component State, Out-of-band swaps, Extensions, and SSE support natively within ProcessWire.
  • Intervention Image Engine

    Replaces PW sizing with Intervention Image + Delayed Rendering using ImageManager logic.
  • Component

    Module help you to create and use set of components to utilise in your ProcessWire page templates.
  • Vite

    Vite adapter for ProcessWire

All modules by Iskender TOTOGLU

Install and use modules at your own risk. Always have a site and database backup before installing new modules.