Skip to content
Ripple
v4.x
Ripple 4.x for Doppar 4

Build reactive interfaces in pure PHP.

Ripple is server-driven UI for the Doppar Framework. Write components in PHP and Odo, and Ripple renders on the server and patches only what changed in the browser.

Patch Lab · simulated
1Browser● try it
2ComponentPHP
class Counter extends Component
{
    public int $count = 0;

    #[Invokable]
    public function increment(): void
    {
        $this->count++;
    }

    #[Invokable]
    public function decrement(): void
    {
        $this->count--;
    }
}
class Todos extends Component
{
    public array $items = [];

    #[Invokable]
    public function add(string $text): void
    {
        $this->items[] = [
            'id'   => bin2hex(random_bytes(3)),
            'text' => $text,
            'done' => false,
        ];
    }

    #[Invokable]
    public function toggle(string $id): void { /* … */ }

    #[Invokable]
    public function remove(string $id): void { /* … */ }
}
3Request

                        
Response

                    
patches 0 round trips 0 JavaScript you write 0 lines ● state signed
How it works

One round trip per interaction.

The server owns the state and the rendering. The browser only sends actions and applies patches.

Browser Your Doppar app 1 POST /ripple/update action name + HMAC-signed state 2 Ripple on the server Verify the signature, hydrate the component Run your #[Invokable] method Render again and diff old against new 3 200 OK: patches + new signed state {"o":"t","p":"1.0","v":"Count: 1"} 4 Patch the DOM

Read how Ripple works

Build with confidence

Rules once. Tests that mean it.

Validate as users type, and test the real code path from PHPUnit.

Validation that follows the user.

Define your rules once. Ripple re-validates the field a user just edited, shows errors from the same response, and keeps every other input untouched.

  • Doppar's full rule set, with custom messages
  • Live, lazy or debounced binding per input
  • Multi-step wizards with per-step rules
Read the validation guide
class ContactForm extends Component
{
    public string $email = '';
    public string $message = '';

    protected function rules(): array
    {
        return [
            'email'   => 'required|email',
            'message' => 'required|min:10',
        ];
    }

    #[Invokable]
    public function send(): void
    {
        $this->validate();

        // deliver the message…
        $this->email = '';
        $this->message = '';
    }

    public function render(): mixed
    {
        return view('ripple.contact-form');
    }
}

Real payloads, real confidence.

Ripple::test() mounts a component and drives signed update payloads, so your tests exercise exactly what production does.

  • Call actions and set properties fluently
  • Assert state, HTML, errors, redirects and events
  • Locked properties behave exactly like production
Read the testing guide
use Doppar\Ripple\Facade\Ripple;

class CounterTest extends TestCase
{
    public function test_increments(): void
    {
        Ripple::test(Counter::class)
            ->assertSet('count', 0)
            ->call('increment')
            ->assertSet('count', 1)
            ->assertSee('Count: 1');
    }

    public function test_rejects_bad_email(): void
    {
        Ripple::test(ContactForm::class)
            ->set('email', 'not-an-email')
            ->call('send')
            ->assertNotOk()
            ->assertHasErrors('email');
    }
}

Ready to build your first component?

Follow the quick start and you will have a working, reactive component in a few minutes.