Skip to main content

Module page

Module page 

Source
Expand description

Page components: a component whose view renders the whole document.

An embedded component is mounted from a page template with {{ livewire(..) }}. A page component has no page template: its own .livewire view extends the application layout, and the route answers with the component’s rendered markup.

{# resources/views/livewire/post-browser.livewire #}
{% extends "layouts.app" %}
{% block content %}<h1>Posts</h1>{% endblock %}

The route then mounts it exactly as a page would:

let html = livewire::page::render_page(&registry, "post-browser", Params::default())?;

§What a component gains, and does not

The mount lifecycle, props, and the update endpoint are the same as an embedded component’s; only the surrounding document comes from the component. Route parameters and persistent middleware belong to the application’s routing layer, which passes them as props.

Functions§

render_page
Mounts name as a page and returns the markup the route answers with.