Module prelude

Source
Expand description

The Sycamore prelude.

In most cases, it is idiomatic to use a glob import (aka wildcard import) at the beginning of your Rust source file.

use sycamore::prelude::*;

Re-exports§

pub use crate::reactive::*;

Macros§

console_dbg
Debug the value of a variable to the JavaScript console if on wasm32. Otherwise logs it to stdout.
console_log
Log a message to the JavaScript console if on wasm32. Otherwise logs it to stdout.
is_not_ssr
A macro that expands to whether we are in DOM mode or not.
is_ssr
A macro that expands to whether we are in SSR mode or not.
view
A macro for ergonomically creating complex UI complex layouts.

Structs§

Attributes
A special prop type that can be used to spread attributes onto an element.
NodeRef
A reference to a web_sys::Node. This allows imperative access to the node.
View
Represents a view tree.

Traits§

Component
A trait that is automatically implemented by all components.
GlobalAttributes
Attributes that are available on all elements.
GlobalProps
Props that are available on all elements.
HtmlAAttributes
Trait that provides attributes for the <a> HTML element.
HtmlAbbrAttributes
Trait that provides attributes for the <abbr> HTML element.
HtmlAddressAttributes
Trait that provides attributes for the <address> HTML element.
HtmlAreaAttributes
Trait that provides attributes for the <area> HTML element.
HtmlArticleAttributes
Trait that provides attributes for the <article> HTML element.
HtmlAsideAttributes
Trait that provides attributes for the <aside> HTML element.
HtmlAudioAttributes
Trait that provides attributes for the <audio> HTML element.
HtmlBAttributes
Trait that provides attributes for the <b> HTML element.
HtmlBaseAttributes
Trait that provides attributes for the <base> HTML element.
HtmlBdiAttributes
Trait that provides attributes for the <bdi> HTML element.
HtmlBdoAttributes
Trait that provides attributes for the <bdo> HTML element.
HtmlBlockquoteAttributes
Trait that provides attributes for the <blockquote> HTML element.
HtmlBodyAttributes
Trait that provides attributes for the <body> HTML element.
HtmlBrAttributes
Trait that provides attributes for the <br> HTML element.
HtmlButtonAttributes
Trait that provides attributes for the <button> HTML element.
HtmlCanvasAttributes
Trait that provides attributes for the <canvas> HTML element.
HtmlCaptionAttributes
Trait that provides attributes for the <caption> HTML element.
HtmlCiteAttributes
Trait that provides attributes for the <cite> HTML element.
HtmlCodeAttributes
Trait that provides attributes for the <code> HTML element.
HtmlColAttributes
Trait that provides attributes for the <col> HTML element.
HtmlColgroupAttributes
Trait that provides attributes for the <colgroup> HTML element.
HtmlDataAttributes
Trait that provides attributes for the <data> HTML element.
HtmlDatalistAttributes
Trait that provides attributes for the <datalist> HTML element.
HtmlDdAttributes
Trait that provides attributes for the <dd> HTML element.
HtmlDelAttributes
Trait that provides attributes for the <del> HTML element.
HtmlDetailsAttributes
Trait that provides attributes for the <details> HTML element.
HtmlDfnAttributes
Trait that provides attributes for the <dfn> HTML element.
HtmlDialogAttributes
Trait that provides attributes for the <dialog> HTML element.
HtmlDivAttributes
Trait that provides attributes for the <div> HTML element.
HtmlDlAttributes
Trait that provides attributes for the <dl> HTML element.
HtmlDtAttributes
Trait that provides attributes for the <dt> HTML element.
HtmlEmAttributes
Trait that provides attributes for the <em> HTML element.
HtmlEmbedAttributes
Trait that provides attributes for the <embed> HTML element.
HtmlFieldsetAttributes
Trait that provides attributes for the <fieldset> HTML element.
HtmlFigcaptionAttributes
Trait that provides attributes for the <figcaption> HTML element.
HtmlFigureAttributes
Trait that provides attributes for the <figure> HTML element.
HtmlFooterAttributes
Trait that provides attributes for the <footer> HTML element.
HtmlFormAttributes
Trait that provides attributes for the <form> HTML element.
HtmlGlobalAttributes
A trait that is implemented for all elements and which provides all the global HTML attributes.
HtmlH1Attributes
Trait that provides attributes for the <h1> HTML element.
HtmlH2Attributes
Trait that provides attributes for the <h2> HTML element.
HtmlH3Attributes
Trait that provides attributes for the <h3> HTML element.
HtmlH4Attributes
Trait that provides attributes for the <h4> HTML element.
HtmlH5Attributes
Trait that provides attributes for the <h5> HTML element.
HtmlH6Attributes
Trait that provides attributes for the <h6> HTML element.
HtmlHeadAttributes
Trait that provides attributes for the <head> HTML element.
HtmlHeaderAttributes
Trait that provides attributes for the <header> HTML element.
HtmlHgroupAttributes
Trait that provides attributes for the <hgroup> HTML element.
HtmlHrAttributes
Trait that provides attributes for the <hr> HTML element.
HtmlHtmlAttributes
Trait that provides attributes for the <html> HTML element.
HtmlIAttributes
Trait that provides attributes for the <i> HTML element.
HtmlIframeAttributes
Trait that provides attributes for the <iframe> HTML element.
HtmlImgAttributes
Trait that provides attributes for the <img> HTML element.
HtmlInputAttributes
Trait that provides attributes for the <input> HTML element.
HtmlInsAttributes
Trait that provides attributes for the <ins> HTML element.
HtmlKbdAttributes
Trait that provides attributes for the <kbd> HTML element.
HtmlKeygenAttributes
Trait that provides attributes for the <keygen> HTML element.
HtmlLabelAttributes
Trait that provides attributes for the <label> HTML element.
HtmlLegendAttributes
Trait that provides attributes for the <legend> HTML element.
HtmlLiAttributes
Trait that provides attributes for the <li> HTML element.
HtmlLinkAttributes
Trait that provides attributes for the <link> HTML element.
HtmlMainAttributes
Trait that provides attributes for the <main> HTML element.
HtmlMapAttributes
Trait that provides attributes for the <map> HTML element.
HtmlMarkAttributes
Trait that provides attributes for the <mark> HTML element.
HtmlMenuAttributes
Trait that provides attributes for the <menu> HTML element.
HtmlMenuitemAttributes
Trait that provides attributes for the <menuitem> HTML element.
HtmlMetaAttributes
Trait that provides attributes for the <meta> HTML element.
HtmlMeterAttributes
Trait that provides attributes for the <meter> HTML element.
HtmlNavAttributes
Trait that provides attributes for the <nav> HTML element.
HtmlNoscriptAttributes
Trait that provides attributes for the <noscript> HTML element.
HtmlObjectAttributes
Trait that provides attributes for the <object> HTML element.
HtmlOlAttributes
Trait that provides attributes for the <ol> HTML element.
HtmlOptgroupAttributes
Trait that provides attributes for the <optgroup> HTML element.
HtmlOptionAttributes
Trait that provides attributes for the <option> HTML element.
HtmlOutputAttributes
Trait that provides attributes for the <output> HTML element.
HtmlPAttributes
Trait that provides attributes for the <p> HTML element.
HtmlParamAttributes
Trait that provides attributes for the <param> HTML element.
HtmlPictureAttributes
Trait that provides attributes for the <picture> HTML element.
HtmlPreAttributes
Trait that provides attributes for the <pre> HTML element.
HtmlProgressAttributes
Trait that provides attributes for the <progress> HTML element.
HtmlQAttributes
Trait that provides attributes for the <q> HTML element.
HtmlRpAttributes
Trait that provides attributes for the <rp> HTML element.
HtmlRtAttributes
Trait that provides attributes for the <rt> HTML element.
HtmlRubyAttributes
Trait that provides attributes for the <ruby> HTML element.
HtmlSAttributes
Trait that provides attributes for the <s> HTML element.
HtmlSampAttributes
Trait that provides attributes for the <samp> HTML element.
HtmlScriptAttributes
Trait that provides attributes for the <script> HTML element.
HtmlSectionAttributes
Trait that provides attributes for the <section> HTML element.
HtmlSelectAttributes
Trait that provides attributes for the <select> HTML element.
HtmlSmallAttributes
Trait that provides attributes for the <small> HTML element.
HtmlSourceAttributes
Trait that provides attributes for the <source> HTML element.
HtmlSpanAttributes
Trait that provides attributes for the <span> HTML element.
HtmlStrongAttributes
Trait that provides attributes for the <strong> HTML element.
HtmlStyleAttributes
Trait that provides attributes for the <style> HTML element.
HtmlSubAttributes
Trait that provides attributes for the <sub> HTML element.
HtmlSummaryAttributes
Trait that provides attributes for the <summary> HTML element.
HtmlSupAttributes
Trait that provides attributes for the <sup> HTML element.
HtmlTableAttributes
Trait that provides attributes for the <table> HTML element.
HtmlTbodyAttributes
Trait that provides attributes for the <tbody> HTML element.
HtmlTdAttributes
Trait that provides attributes for the <td> HTML element.
HtmlTemplateAttributes
Trait that provides attributes for the <template> HTML element.
HtmlTextareaAttributes
Trait that provides attributes for the <textarea> HTML element.
HtmlTfootAttributes
Trait that provides attributes for the <tfoot> HTML element.
HtmlThAttributes
Trait that provides attributes for the <th> HTML element.
HtmlTheadAttributes
Trait that provides attributes for the <thead> HTML element.
HtmlTimeAttributes
Trait that provides attributes for the <time> HTML element.
HtmlTitleAttributes
Trait that provides attributes for the <title> HTML element.
HtmlTrAttributes
Trait that provides attributes for the <tr> HTML element.
HtmlTrackAttributes
Trait that provides attributes for the <track> HTML element.
HtmlUAttributes
Trait that provides attributes for the <u> HTML element.
HtmlUlAttributes
Trait that provides attributes for the <ul> HTML element.
HtmlVarAttributes
Trait that provides attributes for the <var> HTML element.
HtmlVideoAttributes
Trait that provides attributes for the <video> HTML element.
HtmlWbrAttributes
Trait that provides attributes for the <wbr> HTML element.
Props
A trait that is implemented automatically by the Props derive macro.
SvgAnimateAttributes
Trait that provides attributes for the <animate> SVG element.
SvgAnimateMotionAttributes
Trait that provides attributes for the <animateMotion> SVG element.
SvgAnimateTransformAttributes
Trait that provides attributes for the <animateTransform> SVG element.
SvgCircleAttributes
Trait that provides attributes for the <circle> SVG element.
SvgClipPathAttributes
Trait that provides attributes for the <clipPath> SVG element.
SvgDefsAttributes
Trait that provides attributes for the <defs> SVG element.
SvgDescAttributes
Trait that provides attributes for the <desc> SVG element.
SvgDiscardAttributes
Trait that provides attributes for the <discard> SVG element.
SvgEllipseAttributes
Trait that provides attributes for the <ellipse> SVG element.
SvgFeBlendAttributes
Trait that provides attributes for the <feBlend> SVG element.
SvgFeColorMatrixAttributes
Trait that provides attributes for the <feColorMatrix> SVG element.
SvgFeComponentTransferAttributes
Trait that provides attributes for the <feComponentTransfer> SVG element.
SvgFeCompositeAttributes
Trait that provides attributes for the <feComposite> SVG element.
SvgFeConvolveMatrixAttributes
Trait that provides attributes for the <feConvolveMatrix> SVG element.
SvgFeDiffuseLightingAttributes
Trait that provides attributes for the <feDiffuseLighting> SVG element.
SvgFeDisplacementMapAttributes
Trait that provides attributes for the <feDisplacementMap> SVG element.
SvgFeDistantLightAttributes
Trait that provides attributes for the <feDistantLight> SVG element.
SvgFeDropShadowAttributes
Trait that provides attributes for the <feDropShadow> SVG element.
SvgFeFloodAttributes
Trait that provides attributes for the <feFlood> SVG element.
SvgFeFuncAAttributes
Trait that provides attributes for the <feFuncA> SVG element.
SvgFeFuncBAttributes
Trait that provides attributes for the <feFuncB> SVG element.
SvgFeFuncGAttributes
Trait that provides attributes for the <feFuncG> SVG element.
SvgFeFuncRAttributes
Trait that provides attributes for the <feFuncR> SVG element.
SvgFeGaussianBlurAttributes
Trait that provides attributes for the <feGaussianBlur> SVG element.
SvgFeImageAttributes
Trait that provides attributes for the <feImage> SVG element.
SvgFeMergeAttributes
Trait that provides attributes for the <feMerge> SVG element.
SvgFeMergeNodeAttributes
Trait that provides attributes for the <feMergeNode> SVG element.
SvgFeMorphologyAttributes
Trait that provides attributes for the <feMorphology> SVG element.
SvgFeOffsetAttributes
Trait that provides attributes for the <feOffset> SVG element.
SvgFePointLightAttributes
Trait that provides attributes for the <fePointLight> SVG element.
SvgFeSpecularLightingAttributes
Trait that provides attributes for the <feSpecularLighting> SVG element.
SvgFeSpotLightAttributes
Trait that provides attributes for the <feSpotLight> SVG element.
SvgFeTileAttributes
Trait that provides attributes for the <feTile> SVG element.
SvgFeTurbulenceAttributes
Trait that provides attributes for the <feTurbulence> SVG element.
SvgFilterAttributes
Trait that provides attributes for the <filter> SVG element.
SvgForeignObjectAttributes
Trait that provides attributes for the <foreignObject> SVG element.
SvgGAttributes
Trait that provides attributes for the <g> SVG element.
SvgGlobalAttributes
A trait that is implemented for all SVG elements and which provides all the global SVG attributes.
SvgHatchAttributes
Trait that provides attributes for the <hatch> SVG element.
SvgHatchpathAttributes
Trait that provides attributes for the <hatchpath> SVG element.
SvgImageAttributes
Trait that provides attributes for the <image> SVG element.
SvgLineAttributes
Trait that provides attributes for the <line> SVG element.
SvgLinearGradientAttributes
Trait that provides attributes for the <linearGradient> SVG element.
SvgMarkerAttributes
Trait that provides attributes for the <marker> SVG element.
SvgMaskAttributes
Trait that provides attributes for the <mask> SVG element.
SvgMetadataAttributes
Trait that provides attributes for the <metadata> SVG element.
SvgMpathAttributes
Trait that provides attributes for the <mpath> SVG element.
SvgPathAttributes
Trait that provides attributes for the <path> SVG element.
SvgPatternAttributes
Trait that provides attributes for the <pattern> SVG element.
SvgPolygonAttributes
Trait that provides attributes for the <polygon> SVG element.
SvgPolylineAttributes
Trait that provides attributes for the <polyline> SVG element.
SvgRadialGradientAttributes
Trait that provides attributes for the <radialGradient> SVG element.
SvgRectAttributes
Trait that provides attributes for the <rect> SVG element.
SvgSetAttributes
Trait that provides attributes for the <set> SVG element.
SvgStopAttributes
Trait that provides attributes for the <stop> SVG element.
SvgSvgAAttributes
Trait that provides attributes for the <svg_a> SVG element.
SvgSvgAttributes
Trait that provides attributes for the <svg> SVG element.
SvgSvgScriptAttributes
Trait that provides attributes for the <svg_script> SVG element.
SvgSvgStyleAttributes
Trait that provides attributes for the <svg_style> SVG element.
SvgSvgTitleAttributes
Trait that provides attributes for the <svg_title> SVG element.
SvgSwitchAttributes
Trait that provides attributes for the <switch> SVG element.
SvgSymbolAttributes
Trait that provides attributes for the <symbol> SVG element.
SvgTextAttributes
Trait that provides attributes for the <text> SVG element.
SvgTextPathAttributes
Trait that provides attributes for the <textPath> SVG element.
SvgTspanAttributes
Trait that provides attributes for the <tspan> SVG element.
SvgUseAttributes
Trait that provides attributes for the <use> SVG element.
SvgViewAttributes
Trait that provides attributes for the <view> SVG element.

Functions§

Indexed
Non keyed iteration (or keyed by index).
Keyed
Keyed iteration.
create_node_ref
Create a new NodeRef.
document
Utility function for accessing the global web_sys::Document object.
on_mount
Queue up a callback to be executed when the component is mounted.
window
Utility function for accessing the global web_sys::Window object.

Type Aliases§

Children
A type alias for Children automatically selecting the correct node type.

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.

Derive Macros§

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