Jaspr API Reference
API Reference for the Jaspr Web Framework.
This is the API reference documentation for the Jaspr Web Framework. It provides a comprehensive overview of the most important components and utilities available in the framework.
This is not the complete API reference. For a complete reference, please refer to the generated API Reference on pub.dev.
This documentation is split into the sections:
Components
DocumentComponentThe Document component sets up and controls the basic document structure.
RawTextComponentRenders raw HTML from a String.
AsyncBuilderComponentServer-side components with an async build method.
AsyncStatelessComponentComponentServer-side components with an async build method.
RouterComponentHandles routing between different pages both server- and client-side.
LinkComponentHandles any kind of link.
StyleComponentRenders the provided StyleRules into css and wraps them with a <style> element.
FlutterEmbedViewComponentEmbed a flutter app in your Jaspr side.
JasprBadgeComponentDisplays a "Built with Jaspr" badge.
General
runAppFunctionRuns your Jaspr site on either the server or the client.
StylesClassType-safe Dart bindings of CSS properties.
@css / css()Annotation / FunctionStyling utility to write nested style rules.
events()FunctionType-safe event bindings for HTML components.
GlobalNodeKeyClassGet access to the unterlying dom node of a component.
ViewTransitionMixinMixinEasily transition between ui states with View Transitions.
Server / Client
@clientAnnotationWith the @client annotation you can automatically hydrate selected components on the client.
@encoder / @decoderAnnotationSetup encoding and decoding for custom data types.
@ImportAnnotationHow to import platform-specific libraries in shared components.
@syncAnnotationEasy data synchronization with support for custom data types.
SyncStateMixinMixinSyncing the state of a StatefulComponent from server to client.
PreloadStateMixinMixinAsynchronously preloading the state of a StatefulComponent on the server.
headers / setHeader()Accessor / FunctionAccess request headers and set response headers.
cookies / setCookie()Accessor / FunctionAccess request cookies and set response cookies.
setStatusCode()FunctionSet the response status code and body.

