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.
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 { /* … */ }
}One round trip per interaction.
The server owns the state and the rendering. The browser only sends actions and applies patches.
Nine building blocks, one package.
Forms, validation, events, uploads, navigation and testing are built in. You write PHP and Odo.
Components
State, actions and a view in one PHP class, created with make:ripple.
Data binding
Sync inputs with properties using ripple:bind, live, lazy or debounced.
Validation
Doppar rules inside components, with live per-field checks and errors in the same response.
Read the guide 04Events
Dispatch between components on a page, or fire browser CustomEvents.
URL state
Mark a property with #[QueryString] and filters and pages survive refresh and sharing.
File uploads
Temporary uploads with instant previews, moved to permanent storage on save.
Read the guide 07Lazy loading & polling
Defer heavy widgets until after first paint, and refresh them with ripple:poll.
Soft navigation
SPA-style page transitions with ripple:navigate and soft redirects.
State & security
HMAC-signed state, locked properties and an explicit invokable gate for every action.
Read the guideRules 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
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
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.