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.

Shared React 19 + Inertia.js v3 + Tailwind CSS v4 UI runtime, dual-context admin shell (ProcessReact), dual-mode form & media controls, Tiptap v3 rich text editor (InputfieldTiptap), centralized vector icon engine (IconManager), interactive data viewports, typed TypeScript SDK (@pw/react/*), and optional ProcessReactWorkspace hub for ProcessWire 3.0.271+ and PHP 8.4+.

React

React maps ProcessWire's --pw-* admin color scheme variables onto semantic design tokens (--background, --foreground, --primary, --muted, --border, --ring) and compiles each companion module and adapter engine into self-contained dist/ bundles loaded strictly on demand.

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


Documentation


Deep architectural guides, subsystem walkthroughs, and API references live in docs/:

Context / What You NeedTarget Document
Architecture Overview & Component Mapdocs/ARCHITECTURE.md
Documentation Index & Reading Mapdocs/README.md
System Architecture, Tech Stack, CI, Runtime Surface & ADRs01 — Architecture & Technical Deep-Dive
Admin Modules, Dual-Context Shell, Flyout Nav, Hub & Central Themes02 — Workspaces, Dual-Context Shell & Themes
SchemaForm, Tabs, Key-Value, Links, Icons, Media Studio, Relations & Tiptap03 — Inputfields, Forms & Rich Text (InputfieldTiptap)
MarkupReactTable, MarkupReactCards, Pluggable Modes & Capability Providers04 — Viewports & Data Providers
22-Pass Vite Build, @pw/react/* SDK, Delta CSS Layers, i18n & Security05 — Frontend Runtime, Typed SDK, i18n & Security
Complete PHP & Asset Reference DictionaryAPI.md
Internal Contributor Invariants & BoundariesAGENTS.md

Requirements


  • PHP: >= 8.4
  • ProcessWire: >= 3.0.271
  • Required Module: Inertia (Totoglu\Inertia)

Installation


composer require trk/processwire-react
php vendor/bin/wire module:install --name=React --json
# Optional unified Admin > Workspace dashboard & cross-module switcher:
php vendor/bin/wire module:install --name=ProcessReactWorkspace --json

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

Companion ModulesRole & Guide
MarkupReactTable, MarkupReactCardsSortable, filterable, inline-editable table and responsive card viewports (04 — Viewports)
MarkupReactTabWAI-ARIA tab container (line, segmented, vertical) with lazyLoad and nested asset handling (03 — Inputfields)
InputfieldReactKeyValue, InputfieldReactLinkAssociative key-value editor and multi-target polymorphic link control with isolated link media (03 — Inputfields)
InputfieldReactConditionVisual 2-level condition rule builder (source + condition + value/field, AND/OR/NOT groups, live summary preview) paired with ConditionEvaluator & TS evaluateConditionTree (API.md)
InputfieldReactIconSearchable 6,545-variant vector icon picker (5,491 outline + 1,054 filled) and CSS mask-image admin icon engine (03 — Vector Icons)
InputfieldReactM2O, M2M, O2M, M2ARelational pickers backed by 8 core resource adapters and lazy custom adapters (03 — Relations)
InputfieldTiptap, TextformatterTiptapMiniBlocksTiptap v3 rich text editor (core/editor/canvas/blocks), native link/image dialogs, and flat mini-blocks (03 — Tiptap)
InputfieldReactFile, InputfieldReactImageDropzone upload studio, focus/crop/rotate/flip editor, palette inspection, and multi-language alt/description metadata (03 — Media Studio)

Quick Start


1. Build a Dual-Context Admin Module (ProcessReact)

Extend Totoglu\React\Inertia\ProcessReact so a single React component runs natively inside AdminTheme via Setup > <Module> and full-screen inside Admin > Workspace (?ws=1) when ProcessReactWorkspace is installed, with clickable flyout navigation via buildAdminNavJSON(). Register workspaces lazily via React::deferModuleRegistration() and navigation icons eagerly during init() (02 — Workspaces & Admin Shell).

<?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 Standalone Interactive Viewports

Render MarkupReactTable or MarkupReactCards inside any classic ProcessWire 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 (InputfieldReactIcon & IconManager)

Attach InputfieldReactIcon to any FieldtypeText field or invoke IconManager directly (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::getModuleConfigInputfields()):

SettingTypeDefaultDescription
defaultThemestring'system'Fallback mode ('system', 'light', 'dark').
themePresetstring'native'Central preset across workspaces, panels, overlays, and controls (native, neutral, slate, stone, ocean, indigo, teal, custom).
themeCustomTokensstring''Sanitized Tailwind CSS v4 :root / .dark variables used when themePreset is custom (requires --background, --foreground, --primary, --primary-foreground).
defaultShellLayoutstring'topbar'Default navigation shell layout applied across React workspaces when a user has not chosen a personal override ('topbar', 'sidebar', or registered custom layout ID).
enableKeyboardShortcutsbooltrueEnables Cmd/Ctrl+K command palette, Cmd/Ctrl+B sidebar toggle, ? help dialog, form save shortcuts, and viewport hotkeys.
adminReturnLabelstring'Panel'Localized top-left return label in Workspace mode (supports multi-language values).
useReactMediaFieldsboolfalseUpgrades standard InputfieldImage / InputfieldFile fields on Pages (including Repeaters) to InputfieldReactImage / InputfieldReactFile.
enableAdminVectorIconsbooltrueInjects the Vector Icon picker on Templates/Fields and generates site/assets/vector-icons/VectorIcons.css.
adminIconPreviewSizeint28Preview size in pixels (16–64) on Edit Template and Edit Field.

[!TIP] Authenticated users can choose personal theme modes, color presets, panel layout (topbar / sidebar), and collapsed sidebar rail state from the Workspace account menu (persisted to site/assets/cache/React/workspaces/{user-id}.json). See 02 — Theme Engine.


Hooks & Extension Seams


All discovery hooks execute lazily on first registry access via 'autoload' => false + 'reactCapabilities' => [...] pull-discovery (React::deferModuleRegistration, deferShellLayoutRegistration, deferCommandSearchRegistration, deferProviderRegistration, deferRelationRegistration, deferMediaHostRegistration, deferViewportModeRegistration, deferLinkResolverRegistration, plus React::forgetSharedViewportMode() cleanup in React.module.php):

  • Hookable React Methods: ___registerWorkspaces(), ___registerWidgets(), ___registerShellLayouts(), ___registerCommandSearch(), ___registerProviders(), ___registerRelationResources(), ___registerMediaHosts(), ___registerViewportModes(), ___registerLinkResolvers(), ___translations().
  • Editorial Mini-Block Hook: InputfieldTiptap::registerMiniBlocks for adding custom flat [data-tiptap-block] types rendered via ./site/templates/tiptap/{name}.php.
  • Hooks & Signatures: See API.md (including FormSchemaSerializer surface: 'card' native tabs-over-card [data-rw-card-tabs="above"], appendDeleteTab(), presenceToken co-edit banners, WireTab metadata preservation, [data-rw-meta-*]/[data-rw-ref-*]/[data-rw-rev-table]/[data-rw-diff-pill] semantic CSS contracts, InputfieldReactLink typeLabels, and canonical controls: date, time, datetime, daterange, color, tags, combobox (country, countries, timezone, currency_code), phone, unit_number/currency with unitVariant: 'currency', segmented, spacing, range, range_slider, colspan, otp, password, markdown, condition_builder, rating, signature, calculation, repeater, keyvalue, link, icon, relation, file, image, tiptap).
  • Full Signature Dictionary: See API.md and chapters 02–04.

Internal Endpoints & Multi-Language Packs


React registers eight URL hooks (React.module.php) and delivers native ProcessWire LanguageTranslator catalogs via locale-scoped Inertia OnceProp keys (languages/{en,tr,de,fr,es,ru}.csv):

EndpointPurpose
/_react/viewportSigned table/cards/pluggable viewport queries, inline/quick edits, bulk actions, saved views, and exports
/_react/workspace-prefsPer-user Workspace favorites, Bento grid layout JSON import/export, themeMode, themePreset, shellLayout, and sidebarCollapsed
/_react/presenceConcurrent co-editor heartbeats (15s) and remote-save staleness alerts
/_react/relationSigned relational search, tree loading, hydration, and O2M link/unlink/quick-create actions
/_react/mediaSigned multipart file/image uploads, replacement, crop/rotate/flip transforms, and palette inspection
/_react/tiptapSigned page/file/anchor lookup and -is Pageimage variation/upload gateway
/_react/iconsRead-only GET paginated catalog search (action=query) and microtask hydration (action=hydrate)
/_react/command-searchRead-only GET RBAC-scoped command palette search across registered providers and editable pages

Security & Verification


[!IMPORTANT] State-changing /_react/* requests enforce authenticated users (AccessGuard), $session->CSRF validation (X-CSRF-TOKEN / X-XSRF-TOKEN / request _token), POST method checks, demo-mode guards, 2 MiB / depth-64 JSON limits, and HMAC-SHA256 tokens bound to $user->id (uid), $config->userAuthSalt, domain typ, and 24-hour iat TTL (SignedTokenCodec). See 05 — Security Architecture.

Run verification checks sequentially against the workspace root (details and CI gates in 01 — Architecture):

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.