Expand description
Web support for Sycamore.
Re-export of the [sycamore_web
] crate.
Modules§
- Definition for bind-able attributes/properties.
- Definition for all the events that can be listened to.
- Bindings to JavaScript’s standard, built-in objects, including their methods and properties.
- Definition of all the HTML and SVG elements.
Macros§
macro_rules!
equivalent ofcfg_not_ssr
. This is to get around the limitation of not being able to put proc-macros onmod
items.macro_rules!
equivalent ofcfg_ssr
. This is to get around the limitation of not being able to put proc-macros onmod
items.- Debug the value of a variable to the JavaScript console if on wasm32. Otherwise logs it to stdout.
- Prints an error message to the JavaScript console if on wasm32. Otherwise logs it to stderr.
- Log a message to the JavaScript console if on wasm32. Otherwise logs it to stdout.
- Log a warning to the JavaScript console if on wasm32. Otherwise logs it to stderr.
- A macro that expands to whether we are in DOM mode or not.
- A macro that expands to whether we are in SSR mode or not.
Structs§
- A special prop type that can be used to spread attributes onto an element.
- A struct representing a custom element. This can be created by calling
custom_element
. - Props for
Keyed
. - Props for
Keyed
. - Props for
NoHydrate
. - Props for
NoSsr
. - A reference to a
web_sys::Node
. This allows imperative access to the node. - Props for
Portal
. - Represents a asynchronous resource.
- Props for
Show
. - Props for
Suspense
andTransition
. - Represents a view tree.
Enums§
- The mode in which SSR is being run.
Traits§
- A trait for unwrapping a type into an
HtmlNode
. - A trait that represents an attribute that can be set. This is not “attribute” in the HTML spec sense. It can also represent JS properties (and possibly more …) that can be set on an HTML element.
- Attributes that are available on all elements.
- Props that are available on all elements.
- A trait that is implemented for all elements and which provides all the global HTML attributes.
- Implemented for all types that can accept attributes (
AttributeValue
). - A trait that is implemented for all SVG elements and which provides all the global SVG attributes.
- A trait that should be implemented for anything that represents an HTML node.
- A trait that should be implemented for anything that represents a node in the view tree (UI tree).
Functions§
- Component that creates a script element for bootstrapping hydration. Should be rendered into the
<head>
of the document. - Non keyed iteration (or keyed by index).
- Keyed iteration.
- Components that do not need, or should not be hydrated on the client side.
- Component that is only renders its children on the client side.
- A portal into a different part of the DOM. Only renders in client side rendering (CSR) mode. Does nothing in SSR mode.
- An utility component that only renders its children when a condition is satisfied.
Suspense
lets you wait forasync
tasks to complete before rendering the UI. This is useful for asynchronous data-fetching or other asynchronous tasks.Transition
is likeSuspense
except that it keeps the previous content visible until the new content is ready.- Convert an async component to a regular sync component. Also wraps the async component inside a suspense scope so that content is properly suspended.
- Create a new effect, but only if we are not in SSR mode.
- Create a resrouce that will only be resolved on the client side.
- Create a new
NodeRef
. - Create a new custom element with
tag
. - Utility function for accessing the global
web_sys::Document
object. - Generate a script element for bootstrapping hydration.
- Render a
View
under aparent
node by reusing existing nodes (client side hydration). - Render a
View
under aparent
node, in a way that can be cleaned up. - Render a
View
under aparent
node by reusing existing nodes (client side hydration). - Returns whether we are currently hydrating or not.
- Queue up a callback to be executed when the component is mounted.
- Alias for
queueMicrotask
. - Render a
View
under aparent
node, in a way that can be cleaned up. - Renders a
View
to a stream. - Get the next counter value. This is stable across client and server side.
- Get the next suspense key.
- Utility function for accessing the global
web_sys::Window
object.
Type Aliases§
- Type alias respresenting a possibly dynamic boolean value.
- A type alias for
Children
automatically selecting the correct node type. - A type alias for the rendering backend.
- Type alias representing a possibly dynamic string value.