Expand description
§Sycamore API Documentation
Sycamore is a reactive library for creating web apps in Rust and WebAssembly.
This is the API docs for sycamore. If you are looking for the usage docs, checkout the Sycamore Book.
§Feature Flags
-
hydrate
- Enables hydration support in DOM nodes. By default, hydration is disabled to reduce binary size. -
serde
- Enables serializing and deserializingSignal
s and other wrapper types usingserde
. -
suspense
- Enables wrappers aroundwasm-bindgen-futures
to make it easier to extend a reactive scope into anasync
function. -
nightly
- Enables nightly-only features. This makes it slightly more ergonomic to use signals. -
wasm-bindgen-interning
(default) - Enables interning forwasm-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.
Modules§
- easing
- Easing functions.
- futures
- Utilities for working with async.
- motion
- Utilities for smooth transitions and animations.
- prelude
- The Sycamore prelude.
- reactive
- Reactive primitives for Sycamore.
- web
- Web support for Sycamore.
Macros§
- view
- A macro for ergonomically creating complex UI complex layouts.
Functions§
- hydrate
- Render a
View
under aparent
node by reusing existing nodes (client side hydration). - hydrate_
in_ scope - Render a
View
under aparent
node, in a way that can be cleaned up. - hydrate_
to - Render a
View
under aparent
node by reusing existing nodes (client side hydration). - render
- Render a
View
into the DOM. Alias forrender_to
withparent
being the<body>
tag. - render_
in_ scope - Render a
View
under aparent
node, in a way that can be cleaned up. - render_
to - Render a
View
under aparent
node. For rendering under the<body>
tag, userender
instead. - render_
to_ string - Render a
View
into a staticString
. Useful for rendering to a string on the server side. - render_
to_ string_ await_ suspense - Renders a
View
into a staticString
while awaiting for all suspense boundaries to resolve. Useful for rendering to a string on the server side. - render_
to_ string_ in_ scope - Render a
View
into a staticString
in the current reactive scope. - render_
to_ string_ stream - Renders a
View
to a stream.
Attribute Macros§
- cfg_
not_ ssr - A macro for feature gating code that should only be run on the web.
- cfg_ssr
- A macro for feature gating code that should only be run on the server.
- component
- A macro for creating components from functions.