livewire·rust

Reference

The tables that answer “what is it called, and what is the default”.

attribute forms
#[livewire(validate(required, max_length(255)))]
pub name: String,

#[livewire(url(as = "q", use = "replace"))]
pub search: String,

#[livewire(model)]
pub post: ModelRef<Post>,
Live exampleopen ↗

Every attribute in the tables has a working example on this site; this frame renders one of them.

Commands

CommandWhat it does
make:livewire <name>Writes a component and its view. Options: --class, --sfc (default), --mfc, --inline, --js, --css, --test, --force, --path.
livewire:make <name>Alias of make:livewire, same options.
livewire:configPrints the resolved LivewireConfig.
livewire:layout <name>Writes a layout a page component can extend.
livewire:convert <name>Converts between the single-file and module-plus-view forms; --remove-view deletes the leftover view.
livewire:publish [--assets]Copies the runtime and stubs into public/vendor/livewire; the server then serves the published build.
livewire:stubsWrites the stubs make:livewire copies, so an application can change them.
livewire:configure-s3-upload-cleanupReports the upstream not-an-S3-disk error on the local disk; the bucket-lifecycle branch is unsupported here, and the local directory is pruned by the schedule instead.

Configuration

The section is a LivewireConfig. Without one, LivewireConfig::of returns these defaults.

FieldDefaultMeaning
component_locationsresources/views/components, resources/views/livewiredirectories searched for component views, in order
component_namespaceslayouts → resources/views/layouts; pages → resources/views/pagesnamespaces that resolve against a directory
component_layoutlayouts::appthe view that wraps a page component
component_placeholderNonethe view a lazy component shows; None uses the built-in placeholder
make_commandkind: Sfc, emoji: true, others falsethe defaults of make:livewire
component_pathsrc/livewirewhere generated modules go
view_pathresources/views/livewirewhere generated views go
temporary_file_uploadrules required, file, max:12288; 16 preview extensions; 5 minutes; cleanup onhow temporary uploads are stored, validated, previewed, and expired
render_on_redirectfalsewhether a redirecting component renders before the redirect
legacy_model_bindingfalsewhether wire:model may bind a model directly
inject_assetstruewhether HTML responses get the runtime injected
navigateprogress bar on, #2299ddhow wire:navigate presents a visit
inject_morph_markerstruemorph comments around conditionals and loops
smart_wire_keystruederived keys for components inside loops
pagination_themeTailwindthe CSS framework the pagination views target
release_token"a"the token a redeployment changes, which expires old snapshots
csp_safefalseserve and run the CSP-safe build
asset_urlNonea base URL for the runtime, when it is not served by the application
update_uriNonea path for the update endpoint other than the default
payload.max_size1048576bytes of request body; None disables the guard
payload.max_nesting_depth10property path depth
payload.max_calls50method calls per request
payload.max_components200components per request

Endpoints

Every path starts with a prefix derived from the application key: /livewire- and the first eight hex characters of SHA-256(app key + "livewire-endpoint"). The pages never hard-code it; the snapshot and the script configuration carry it.

PathMethodPurpose
{prefix}/updatePOSTthe update endpoint
{prefix}/upload-filePOSTa temporary upload
{prefix}/preview-file/{filename}GETa temporary file whose kind may be previewed
{prefix}/livewire.js, livewire.min.js, livewire.csp.min.js, and their .map filesGETthe browser runtime
{prefix}/js/{component}.jsGETa component's JavaScript module
{prefix}/css/{component}.cssGETa component's scoped style module
{prefix}/css/{component}.global.cssGETa component's global style module

Statuses

StatusWhen
404no X-Livewire header, a body that is not JSON, a malformed component, call, or snapshot, an update from another origin, a retired release token on a custom endpoint
419a failed checksum, a release-token mismatch, an unknown or forbidden action, an update to a locked property, a typed hydration failure
429the checksum-failure allowance is spent: Too many invalid Livewire requests. Please try again later.
500an unknown component or synthesizer, an unknown property, or a payload, component-count, call-count, or nesting-depth guard
401an upload endpoint with an invalid signature
403a signed temporary-file reference that does not hold, or a denied action
422an upload that breaks its rules

Testing

The harness mounts a component, runs it, and asserts on the result. The assertions that exist:

AssertionChecks
assert_set(path, value)a property after an update, at a dot path
assert_see(text) / assert_dont_see(text)the rendered HTML
assert_dispatched(event)a browser event in the effects
assert_redirected_to(url)a redirect effect

For anything else, animate the real endpoint: GET the page, read wire:snapshot out of the HTML, and POST an update with the X-Livewire header. That path never skips the checksum.

Directives in the browser

The runtime is upstream's, unchanged, so its directives behave as upstream documents them. They are client features: the server never sees them.

DirectiveEffect
wire:model, .live, .blur, .change, .debouncetwo-way binding, with modifiers
wire:click, wire:submitdispatch an action
wire:show, wire:text, wire:bindreactive display without a request
wire:loading, wire:dirty, wire:offlinestate of the pending or failing request
wire:poll, wire:init, wire:intersect, wire:sorttimed, immediate, viewport, and drag interactions
wire:transition, wire:cloak, wire:ignore, wire:replaceanimation and DOM control
wire:navigate, wire:current, wire:confirmnavigation and confirmation
wire:ref, wire:stream, wire:keyreferences, streamed regions, stable identity

Feature matrix

The authoritative list is STATUS.md in the repository. The overview page states it in first-class form: what is included, what is missing, the order to close it, and what differs from PHP by design. The matrix:

AreaState
Protocol: snapshots, checksum, release tokens, limits, error statusesdone
Components: derive, attributes, lifecycle, actions, validation, events, effectsdone
Composition: nesting, slots, reactive props, modelable, lazy, islands, modules, SFCdone
Uploads, previews, streaming, cleanup scheduledone
Pages, route context, origin check, persistent guardsdone
Model references, pagination, computed propertiesdone behind database
Form objects: a nested struct with #[livewire(form)]done; the client updates field.subfield paths
livewire:form and livewire:attribute generatorsabsent; see STATUS.md
S3 storageabsent; the cleanup command says so