itecho/brickphp

Server-powered web applications, built brick by brick — entirely in PHP. No JavaScript framework, no build pipeline, no Node.

Maintainers

Package info

github.com/wbijker/brickphp

pkg:composer/itecho/brickphp

Transparency log

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

v0.1.1 2026-06-22 07:31 UTC

This package is auto-updated.

Last update: 2026-07-13 21:56:20 UTC


README

Server-powered web applications, built brick by brick — entirely in PHP.

BrickPHP is a server-driven UI framework for PHP. Routing, state, components, events, styling, DOM diffing, and CSS extraction all live in one PHP process — no JavaScript framework, no build pipeline, no Node.

composer require brickphp/brickphp

Hello, BrickPHP

<?php

use BrickPHP\Brick;
use App\App;

require 'vendor/autoload.php';

Brick::run(App::class);
namespace App;

use BrickPHP\State\SessionStateManager;
use BrickPHP\State\StateManager;
use BrickPHP\UI\UI;
use BrickPHP\VNode\App as BrickApp;
use BrickPHP\VNode\Component;
use BrickPHP\VNode\VNode;

class App extends BrickApp
{
    public function title(): string { return 'Counter'; }

    public function state(): StateManager
    {
        return new SessionStateManager();
    }

    protected function view(): VNode
    {
        return new Counter();
    }
}

class Counter extends Component
{
    private int $count = 0;

    protected function initialize(): void
    {
        $this->useState($this->count);
    }

    protected function build(): VNode
    {
        return UI::column()->content(
            UI::text("Count: {$this->count}"),
            UI::button('+')->onClick(fn() => $this->count++),
        );
    }
}

Highlights

  • All in one place — routing, state, components, styling all in PHP.
  • No glue — your UI talks to your data directly; no API layer, no serialization.
  • Hot module reloading — save a file, watch the browser update without losing state.
  • Utility CSS out of the box — semantic methods like padding(Unit::large()) generate CSS at build time.
  • Wireframe inspector — overlay the rendered tree with source locations.
  • Debugging made easy — Xdebug works out of the box; DOM patches surface in the console.
  • UI elements, not JS + CSS — typed UIElement primitives, no className strings, no JSX, no template DSL.

Requirements

  • PHP 8.1+

Samples & docs

See github.com/wbijker/brickphp-samples for the documentation site, runnable sample apps (counter, news, todo, docs), and the Docker dev stack.

License

MIT © Willem Bijker