Skip to main content

Module component

Module component 

Source
Expand description

The authoring contract: what a component is, what it renders, and how the browser’s calls reach it.

A component is a Rust struct whose fields are the wire-public state, plus an inherent implementation annotated with #[livewire::component] that publishes its actions. The derive macro writes LivewireState, so the server never reflects over a type at runtime.

Structs§

Call
One action call, as the browser sent it.
ClassOptions
The options a class-level #[component(..)] attribute declares.
ComponentContext
The context one lifecycle hook or action receives.
Listener
A listener or dispatch a component declares statically.
SessionBinding
How a field persists in the session.
UrlBinding
How a field follows the page’s query string.
WireField
One wire-public field’s rules, generated by the derive in declaration order.

Enums§

ActionResultKind
What an action’s return value means to the response.
ComponentView
What a component’s render asks the engine to render.
Params
One action call’s parameters, as the browser sent them.

Traits§

Component
A component: wire-public state plus the lifecycle the server runs around it.
LivewireState
The wire-public state of a component, generated by #[derive(LivewireComponent)].

Functions§

camel_case
Turns postEditor into postEditor, which is how a browser-written prop name reaches a field.
coerce
Reads a browser-sent value into a field’s type, accepting the strings form inputs send.
lookup_scalar
Reads a scalar out of a wire map by dot path, as a session key’s {placeholder} needs it.
to_wire
Serializes a field for the wire, normalizing negative zero so that snapshots stay stable.

Type Aliases§

Result
The result of an operation in this crate.