adamalexandersson / parity
Schema-driven cross-runtime components for Laravel Blade and WordPress Gutenberg
Requires
- php: ^8.2
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/filesystem: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- illuminate/view: ^11.0|^12.0|^13.0
- opis/json-schema: ^2.4
Requires (Dev)
- gehrisandro/tailwind-merge-php: ^1.0
- larastan/larastan: ^3.0
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.8
- pestphp/pest-plugin-laravel: ^3.0
Suggests
- blade-ui-kit/blade-icons: Required for component() nodes that render SVG icons via @svg().
- gehrisandro/tailwind-merge-php: Required when parity.classes.strategy is "tailwind" (the default). Use "passthrough" otherwise.
- roots/acorn: Required for Sage/WordPress themes that use the Gutenberg editor adapter.
README
Schema-driven cross-runtime components for Laravel Blade and WordPress Gutenberg.
Define a component once in PHP. Parity renders it identically on the front end (Blade) and — on WordPress — in the block editor (window.parity).
Supported environments
| Environment | Blade / schema | Gutenberg editor |
|---|---|---|
| Laravel | Yes | No (use your own bridge if needed) |
| Sage / Acorn + WordPress | Yes | Yes (WordPress host auto-detected) |
Install
composer require adamalexandersson/parity
Full four-step guide (config publish, Vite plugin, manifest): docs/installation.md.
Documentation
| Guide | Contents |
|---|---|
| Installation | Laravel and Sage / Acorn setup |
| Components | Authoring with compose() |
| Schema v1 | Full schema reference |
| Editor | Gutenberg, Vite plugin, canvas helpers |
| Transforms | Built-in and custom value casts |
| Classes | Strategies, presets, tokens |
| Hosts | Laravel and WordPress adapters |
| Testing | Fixtures and parity coverage |
| Upgrading | Package vs schema versioning |
Commands
wp acorn parity:make Button --ui wp acorn parity:manifest wp acorn parity:safelist wp acorn parity:cache wp acorn parity:clear wp acorn parity:doctor
On plain Laravel, use php artisan instead of wp acorn.
Schema version
Parity uses schema version 1.0. The editor runtime warns on a major mismatch and tolerates minor differences. See docs/upgrading.md.
Contributing
See docs/contributing.md. Build the editor bundle with npm run build (output: dist/parity.js).
Escape hatch
Prefer schema attributes (including Alpine helpers) for interactive markup. For exceptional cases only — register a hand-written React component via window.parity.registerComponent('name', MyComponent), or add a theme Blade shell override when the schema cannot express a dynamic loop.
License
MIT