Frontend SDK, Styling & UI Showcase
Downstream modules never bundle their own copy of React, Inertia, or Base UI. Instead, they import from the typed @pw/react/* SDK, which maps at build time onto window.ReactWorkspaceRuntime exposed by dist/ReactInertia.js.
Typed @pw/react/* SDK Subpaths
Section titled “Typed @pw/react/* SDK Subpaths”| SDK Subpath | Key Exports |
|---|---|
@pw/react/core |
React, ReactDOM, ReactDOMClient, Inertia (Link, Head, router, usePage, visitSameModuleHref), registerPages, registerIslands, registerViewport, loadRuntimeScript, loadRuntimeStyle, preloadRuntimeScript, cn, DynamicIcon, URL sanitizers |
@pw/react/ui |
Accessible Base UI primitives (Button, Badge, Card, Dialog, Sheet, Drawer, Tabs, Table, Toast, CommandDialog, StatCard, CliBox, EmptyState, ConfirmDialog) |
@pw/react/layout |
AppShell, RecordHeader, EditPresenceBanner, ModuleSwitcher, UserAccountMenu, SidebarShellLayout, useSidebarCollapsed, useEditPresence, postWorkspacePreferenceAction, renderNoticeMarkup |
@pw/react/viewports |
DataViewport, DataTableCanvas, DataCardsCanvas, viewport registries, and cell helpers |
@pw/react/fields |
SchemaForm, SchemaField, ConditionBuilder, all lazy field controls (Color, Tags, Combobox, Phone, UnitNumber, Segmented, Spacing, Otp, Password, Markdown, File, Image, Icon, Link, KeyValue, Relation), FieldControlIsland, ExtraFieldControlIsland |
@pw/react/hooks |
useTranslations, t, translate, useTheme, THEME_PRESETS, fetchGatewayJson, useDirtyFormBridge, useUnsavedChangesGuard, useEditPresence, KeyboardShortcutsProvider, useKeyboardShortcuts, formatShortcutKeys |
@pw/react/dnd, @pw/react/grid, @pw/react/calendar |
Lazy wrappers for sortable lists/trees (ReactDnd), virtual data grid (ReactGrid), and calendar/date pickers (ReactCalendar) |
@pw/react/optional |
Safe runtime lookup helpers (getOptionalReactRuntime, requireReactRuntime) |
Isolated Bundles & module-delta.css (39 Cascade Sub-Layers)
Section titled “Isolated Bundles & module-delta.css (39 Cascade Sub-Layers)”Use the root vite.module.ts (defineWireModuleConfig) helper to build each companion Process*, Inputfield*, or Markup* entry into its own self-contained IIFE under dist/<Module>.js with zero shared chunk emissions (ReactInertia-*.js) and zero *.style.js leftovers.
For Tailwind CSS v4 utilities in downstream modules:
- Import
React/resources/css/module-delta.css(@tailwind utilities source(none);) with zero Preflight reset so ProcessWire’sAdminThemeUikitstays intact. createTailwindCascadeLayersPlugin()partitions utilities across 39 deterministic@layer utilities.*sub-layers (shorthand,axis,longhand,state, responsivesm-*throughxxl-*, container queriescontainer-3xsthroughcontainer-7xl,container, andmedia) identically across bothReactInertia.cssand downstream module CSS so late-loaded stylesheets never clobber responsive or dark-mode classes.- Consume semantic
--pw-*CSS variables and opt into typography or table isolation using[data-rw-prose-root]and[data-rw-table].
Built-In UI Showcase Studio (/admin/workspace/ui-showcase/)
Section titled “Built-In UI Showcase Studio (/admin/workspace/ui-showcase/)”When $config->debug = true and ProcessReactWorkspace is installed, superusers can open UI Showcase from the Workspace header (or navigate directly to <adminUrl>workspace/ui-showcase/).
The studio lets you inspect all 7 interactive sections (media, links, relations, datetime, contexts, controls, primitives, plus all) across responsive viewport presets (Direct, 1280px, 768px, 420px, 375px, and side-by-side Compare 375/420/768), theme modes (Auto, Light, Dark), and an automated horizontal overflow check (Check Overflow).
You can also deep-link directly to any section or theme with query parameters:
?section=media|links|relations|datetime|contexts|controls|primitives|all?theme=auto|light|dark?embed=1(renders only the isolated section canvas without the studio toolbar)
Accessibility (WCAG 2.1 AA)
Section titled “Accessibility (WCAG 2.1 AA)”All UI primitives (Dialog, Sheet, Popover, Tabs, CommandDialog, Select, Combobox) are built on @base-ui/react with keyboard roving focus, ARIA attributes, high-contrast light and dark tokens, and Escape dismissal.