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.
- Class
Options - The options a class-level
#[component(..)]attribute declares. - Component
Context - The context one lifecycle hook or action receives.
- Listener
- A listener or dispatch a component declares statically.
- Session
Binding - How a field persists in the session.
- UrlBinding
- How a field follows the page’s query string.
- Wire
Field - One wire-public field’s rules, generated by the derive in declaration order.
Enums§
- Action
Result Kind - What an action’s return value means to the response.
- Component
View - What a component’s
renderasks 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.
- Livewire
State - The wire-public state of a component, generated by
#[derive(LivewireComponent)].
Functions§
- camel_
case - Turns
postEditorintopostEditor, 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.