Skip to content

Icons, Tabs & Key-Value Fields

React includes three focused companion modules for vector icons, tabbed form sections, and structured key-value metadata.

Vector Icons (InputfieldReactIcon & IconManager)

Section titled “Vector Icons (InputfieldReactIcon & IconManager)”

React ships 6,545 bundled vector icons compiled into dist/vector-icons.json, served through the read-only /_react/icons endpoint and managed in PHP by Totoglu\React\Icon\IconManager.

Assign InputfieldReactIcon to any text field (or render an icon field in <SchemaForm />) to give editors a fast searchable icon picker with live category filtering and instant SVG preview.

Stored values normalize through Totoglu\React\Icon\ReactIconValue:

<?php
declare(strict_types=1);
namespace ProcessWire;
use Totoglu\React\Icon\IconManager;
$react = React::instance($this);
$icons = $react->icons();
// Render an inline sanitized SVG string from an icon name or ReactIconValue payload
$svg = $icons->renderSvg('compass', [
'size' => 20,
'class' => 'nav-icon',
]);

Admin Vector Icons for Templates, Fields & Admin Pages

Section titled “Admin Vector Icons for Templates, Fields & Admin Pages”

When Enable Vector Icons for ProcessWire Templates, Fields & Admin Pages (enableAdminVectorIcons) is checked under Modules > Configure > React, ProcessWire adds a Vector Icon picker below the standard Icon field on Setup > Templates, Setup > Fields, and Admin page settings. Adjust preview dimensions from 16 to 64 px with adminIconPreviewSize.

Modules can register custom SVG icon packs lazily by declaring 'reactCapabilities' => ['icons'] in getModuleInfo() and calling React::deferIconPackRegistration(...) inside their main module class.

MarkupReactTab (dist/MarkupReactTab.js) renders lightweight, accessible tabbed containers inside classic ProcessWire InputfieldForm screens or custom Process pages without pulling in the full Workspace shell:

<?php
declare(strict_types=1);
namespace ProcessWire;
/** @var MarkupReactTab $tabs */
$tabs = $this->wire()->modules->get('MarkupReactTab');
echo $tabs->render([
'tabs' => [
[
'id' => 'general',
'label' => $this->_('General'),
'icon' => 'settings',
'content' => '<p>General settings panel.</p>',
],
[
'id' => 'advanced',
'label' => $this->_('Advanced'),
'icon' => 'sliders',
'content' => '<p>Advanced options panel.</p>',
],
],
]);

Key-Value Pair Editor (InputfieldReactKeyValue)

Section titled “Key-Value Pair Editor (InputfieldReactKeyValue)”

InputfieldReactKeyValue (dist/InputfieldReactKeyValue.js) turns a standard text or textarea field into a structured, reorderable key-value editor ideal for HTTP headers, custom HTML data attributes, API parameters, or specification tables:

  • Supports drag-and-drop row ordering, duplicate-key validation, optional key/value placeholder labels, and strict JSON persistence.
  • Declares INERTIA_IS_KEYVALUE_FIELD so Inertia’s ScalarFieldDataProvider serializes stored values as structured arrays automatically instead of raw JSON strings.

Next steps