Expand description

Sycamore API Documentation

Sycamore is a VDOM-less web library with fine-grained reactivity.

This is the API docs for sycamore. If you are looking for the usage docs, checkout the Sycamore Book.

Feature Flags

  • hydrate - Enables client-side hydration support.

  • suspense - Enables wrappers around wasm-bindgen-futures to make it easier to extend a reactive scope into an async function.

  • ssr - Enables rendering templates to static strings (useful for Server Side Rendering / Pre-rendering).

  • serde - Enables serializing and deserializing Signals and other wrapper types using serde.

  • wasm-bindgen-interning (default) - Enables interning for wasm-bindgen strings. This improves performance at a slight cost in binary size. If you want to minimize the size of the result .wasm binary, you might want to disable this.

  • web (default) - Enables the web backend for Sycamore. This feature is enabled by most of the other features so you should rarely need to enable it manually.

Re-exports

Modules

The builder pattern API for creating UI elements.
Utilities for components and component properties.
Easing functions.
Iteration utility components for view!.
Utilities for Sycamore when working with futures and async.
Generic rendering backend.
Utilities for client-side hydration in the browser.
Utilities for smooth transitions and animations.
References to nodes in views.
The sycamore prelude.
Re-export of the sycamore-reactive crate.
Suspense with first class async/await support.
Internal utilities for Sycamore.
Abstractions for representing UI views.
Web support for Sycamore.

Macros

Like view! but only creates a single raw node instead.
A macro for ergonomically creating complex UI structures.

Functions

Render a View under a parent node by reusing existing nodes (client side hydration). Alias for hydrate_to with parent being the <body> tag.
Render a View under a parent node, in a way that can be cleaned up. This function is intended to be used for injecting an ephemeral sycamore view into a non-sycamore app (for example, a file upload modal where you want to cancel the upload if the modal is closed).
Render a View under a parent node by reusing existing nodes (client side hydration). For rendering under the <body> tag, use hydrate_to instead.
Render a View into the DOM. Alias for render_to with parent being the <body> tag.
Render a View under a parent node, in a way that can be cleaned up. This function is intended to be used for injecting an ephemeral sycamore view into a non-sycamore app (for example, a file upload modal where you want to cancel the upload if the modal is closed).
Render a View under a parent node. For rendering under the <body> tag, use render instead.
Render a View into a static String. Useful for rendering to a string on the server side.

Attribute Macros

A macro for creating components from functions.

Derive Macros

The derive macro for Prop. The macro creates a builder-like API used in the view! macro.