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 deserializingSignals and other wrapper types usingserde. -
suspense- Enables wrappers aroundwasm-bindgen-futuresto make it easier to extend a reactive scope into anasyncfunction. -
nightly- Enables nightly-only features. This makes it slightly more ergonomic to use signals. -
wasm-bindgen-interning(default) - Enables interning forwasm-bindgenstrings. This improves performance at a slight cost in binary size. If you want to minimize the size of the result.wasmbinary, 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
Viewunder aparentnode by reusing existing nodes (client side hydration). - hydrate_
in_ scope - Render a
Viewunder aparentnode, in a way that can be cleaned up. - hydrate_
to - Render a
Viewunder aparentnode by reusing existing nodes (client side hydration). - render
- Render a
Viewinto the DOM. Alias forrender_towithparentbeing the<body>tag. - render_
in_ scope - Render a
Viewunder aparentnode, in a way that can be cleaned up. - render_
to - Render a
Viewunder aparentnode. For rendering under the<body>tag, userenderinstead. - render_
to_ string - Render a
Viewinto a staticString. Useful for rendering to a string on the server side. - render_
to_ string_ await_ suspense - Renders a
Viewinto a staticStringwhile awaiting for all suspense boundaries to resolve. Useful for rendering to a string on the server side. - render_
to_ string_ in_ scope - Render a
Viewinto a staticStringin the current reactive scope. - render_
to_ string_ stream - Renders a
Viewto 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.