Module prelude Copy item path Source pub use crate::WebComponent ;
pub use crate::Resource ;
pub use crate::ResourceTrait ;
pub use crate::FromProperties ;
pub use crate::NoProperties ;
pub use dioxus ;
pub use crate::logger::tracing as log;
pub use wasm_bindgen_futures ;
dioxus_core dioxus-core dioxus_devtools dioxus_elements dioxus-html
: Html (and SVG) Namespace for Dioxusdioxus_router Dioxus Router document manganis Manganis warnings Warnings that can be triggered by suspicious usage of signals asset The asset macro collects assets that will be included in the final binary capture capture_async client default_impl This macro is used to generate a impl Default
block for any type with the function new_maybe_sync that takes a generic T
desktop eq_impls This macro is used to generate impl PartialEq
blocks for any Readable type that takes a generic T
event expose_component fmt_impls This macro is used to generate impl Display
, and impl Debug
blocks for any Readable type that takes a generic T
fullstack liveview mobile read_impls This macro is used to generate impl Display
, impl Debug
, impl PartialEq
, and impl Eq
blocks for any Readable type that takes a generic T
rsx The rsx! macro makes it easy for developers to write jsx-style markup in their components. server_only ssr to_owned A helper macro for cloning multiple values at once use_reactive A helper macro for use_reactive
that merges uses the closure syntax to elaborate the dependency array web write_impls This macro is used to generate impl Add
, impl AddAssign
, impl Sub
, impl SubAssign
, impl Mul
, impl MulAssign
, impl Div
, and impl DivAssign
blocks for any Writable type that takes a generic T
AnimationData Asset A bundled asset with some options. The asset can be used in rsx! to reference the asset.
It should not be read directly with std::fs::read
because the path needs to be resolved
relative to the bundle Attribute An attribute on a DOM node, such as id="my-thing"
or href="https://example.com"
BundledAsset An asset that should be copied by the bundler with some options. This type will be
serialized into the binary and added to the link section LinkSection::CURRENT
.
CLIs that support manganis, should pull out the assets from the link section, optimize,
and write them to the filesystem at BundledAsset::bundled_path
for the application
to use. Callback The callback type generated by the rsx!
macro when an on
field is specified for components. ClipboardData CompositionData CopyValue CopyValue is a wrapper around a value to make the value mutable and Copy. Coroutine CssAssetOptions Options for a css asset DragData The DragEvent interface is a DOM event that represents a drag and drop interaction. The user initiates a drag by
placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location
(such as another DOM element). Applications are free to interpret a drag and drop interaction in an
application-specific way. Effect A handle to an effect. ErrorContext A context with information about suspended components Event A wrapper around some generic data that handles the event’s state FocusData FolderAssetOptions The builder for [FolderAsset
] FormData FormValue A form value that may either be a list of values or a single value Global A lazy value that is created once per application and can be accessed from anywhere in that application GlobalLazyContext The context for global signals HistoryButtonProps The properties for a GoBackButton
or a GoForwardButton
. ImageAssetOptions Options for an image asset ImageData JsAssetOptions Options for a javascript asset KeyboardData LaunchBuilder A builder for a fullstack app. LinkProps The properties for a Link
. MappedSignal A read only signal that has been mapped to a new type. MediaData Memo Memos are the result of computing a value from use_memo
. Modifiers Pressed modifier keys. MountedData An Element that has been rendered and allows reading and modifying information about it. MouseData A synthetic event that wraps a web-style MouseEvent
Data associated with a mouse event Navigator A view into the navigation state of a router. Owner Owner: Handles dropping generational boxes. The owner acts like a runtime lifetime guard. Any states that you create with an owner will be dropped when that owner is dropped. PlatformEventData A platform specific event. PointerData ReactiveContext Reactivity ReadOnlySignal A signal that can only be read from. ReadableValueIterator An iterator over the values of a Readable<Vec<T>>
. ResizeData RouteParseError An error that occurs when parsing a route. RouterConfig Global configuration options for the router. RouterContext A collection of router data that manages all routing functionality. RouterProps The props for Router
. Runtime A global runtime that is shared across all scopes that provides the async runtime and context API RuntimeGuard A guard for a new runtime. This must be used to override the current runtime when importing components from a dynamic library that has it’s own runtime. ScopeId A component’s unique identifier. ScopeState A component’s rendered state. ScrollData SelectionData SetCompare An object that can efficiently compare a value to a set of values. Signal Signals are a Copy state management solution with automatic dependency tracking. SignalData The data stored for tracking in a signal. SiteMapSegment A type erased map of the site structure. SuspendedFuture A task that has been suspended which may have an optional loading placeholder SuspenseBoundaryProps Properties for the SuspenseBoundary()
component. SuspenseContext A context with information about suspended components SyncStorage A thread safe storage. This is slower than the unsync storage, but allows you to share the value between threads. Task A task’s unique identifier. Template A static layout of a UI tree that describes a set of dynamic and static nodes. ToggleData TouchData TouchPoint TransitionData UnboundedReceiver The receiving end of an unbounded mpsc channel. UnboundedSender The transmission end of an unbounded mpsc channel. UnsyncStorage A unsync storage. This is the default storage type. UseFuture VNode A reference to a template along with any context needed to hydrate it VNodeInner A reference to a template along with any context needed to hydrate it VirtualDom A virtual node system that progresses user events and diffs UI trees. VisibleData WheelData Data associated with a WheelEvent WritableValueIterator An iterator over the values of a Writable<Vec<T>>
. Write A mutable reference to a signal’s value. This reference acts similarly to std::cell::RefMut
, but it has extra debug information
and integrates with the reactive system to automatically update dependents. AssetOptions Settings for a generic asset BorrowError An error that can occur when trying to borrow a value. BorrowMutError An error that can occur when trying to borrow a value mutably. Code Code is the physical position of a key. GlobalKey A key used to identify a signal in the global signal context ImageFormat The type of an image. You can read more about the tradeoffs between image formats here ImageSize The size of an image asset Key Key represents the meaning of a keypress. KeyCode Location The location attribute contains an indication of the logical location
of the key on the device. MountedError The error type for the MountedData NavigationTarget A target for the router to navigate to. NavigationTargetParseError An error that can occur when parsing a NavigationTarget
. RenderError An error that can occur while rendering a component ResizeError The error type for the MountedData ScrollBehavior The way that scrolling should be performed SegmentType The type of a route segment. TemplateAttribute An attribute of the TemplateNode, created at compile time TemplateNode A statically known node in a layout. UseFutureState A signal that represents the state of a future UseResourceState A signal that represents the state of the resource VisibleError The error type for the VisibleData AExtension AbbrExtension AddressExtension AnimateExtension AnimateMotionExtension AnimateTransformExtension AnnotationExtension AnnotationXmlExtension AnyStorage A trait for any storage backing type. AreaExtension ArticleExtension AsideExtension AudioExtension BExtension BaseExtension BdiExtension BdoExtension BlockquoteExtension BodyExtension BrExtension ButtonExtension CanvasExtension CaptionExtension CircleExtension CiteExtension ClipPathExtension CodeExtension ColExtension ColgroupExtension ComponentFunction Any component that implements the ComponentFn
trait can be used as a component. Context Provides context methods to Result
and Option
types that are compatible with CapturedError
DataExtension DatalistExtension DdExtension DefsExtension DelExtension Dependency A dependency is a trait that can be used to determine if a effect or selector should be re-run. DependencyElement A dependency is a trait that can be used to determine if a effect or selector should be re-run. DescExtension DetailsExtension DfnExtension DialogExtension DiscardExtension DivExtension DlExtension DtExtension EllipseExtension EmExtension EmbedExtension FeBlendExtension FeColorMatrixExtension FeComponentTransferExtension FeCompositeExtension FeConvolveMatrixExtension FeDiffuseLightingExtension FeDisplacementMapExtension FeDistantLightExtension FeDropShadowExtension FeFloodExtension FeFuncAExtension FeFuncBExtension FeFuncGExtension FeFuncRExtension FeGaussianBlurExtension FeImageExtension FeMergeExtension FeMergeNodeExtension FeMorphologyExtension FeOffsetExtension FePointLightExtension FeSpecularLightingExtension FeSpotLightExtension FeTileExtension FeTurbulenceExtension FieldsetExtension FigcaptionExtension FigureExtension FilterExtension FooterExtension ForeignObjectExtension FormExtension FromHashFragment Something that can be created from an entire hash fragment. This must be implemented for any type that is used as a hash fragment like #[route("/#:hash_fragment")]
. FromQuery Something that can be created from an entire query string. This trait must be implemented for any type that is spread into the query segment like #[route("/?:..query")]
. FromQueryArgument Something that can be created from a query argument. This trait must be implemented for any type that is used as a query argument like #[route("/?:query")]
. FromRouteSegment Something that can be created from a single route segment. This must be implemented for any type that is used as a route segment like #[route("/:route_segment")]
. FromRouteSegments Something that can be created from multiple route segments. This must be implemented for any type that is spread into the route segment like #[route("/:..route_segments")]
. GExtension GlobalAttributesExtension H1Extension H2Extension H3Extension H4Extension H5Extension H6Extension HasAnimationData A trait for any object that has the data for an animation event HasAttributes A trait for anything that has a dynamic list of attributes HasClipboardData HasCompositionData A trait for any object that has the data for a composition event HasDragData A trait for any object that has the data for a drag event HasFocusData HasFormData An object that has all the data for a form event HasImageData A trait for any object that has the data for an image event HasKeyboardData HasMediaData HasMouseData A trait for any object that has the data for a mouse event HasPointerData A trait for any object that has the data for a pointer event HasResizeData HasScrollData HasSelectionData HasToggleData HasTouchData HasTouchPointData A trait for touch point data HasTransitionData HasVisibleData HasWheelData HatchExtension HatchpathExtension HeadExtension HeaderExtension HgroupExtension History HrExtension HtmlEventConverter A converter between a platform specific event and a general event. All code in a renderer that has a large binary size should be placed in this trait. Each of these functions should be snipped in high levels of optimization. IExtension IframeExtension ImageExtension ImgExtension InitializeFromFunction A trait for an item that can be constructed from an initialization function InputExtension InsExtension InteractionElementOffset A interaction that contains data about the location of the event. InteractionLocation A interaction that contains data about the location of the event. IntoAttributeValue A value that can be converted into an attribute value IntoDynNode A trait that allows various items to be converted into a dynamic node for the rsx macro KbdExtension LabelExtension LegendExtension LiExtension LineExtension LinearGradientExtension LinkExtension MainExtension MapExtension MarkExtension MarkerExtension MaskExtension MathExtension MenuExtension MerrorExtension MetaExtension MetadataExtension MeterExtension MfracExtension MiExtension MmultiscriptsExtension MnExtension MoExtension ModifiersInteraction A interaction that contains data about the current state of the keyboard modifiers. MoverExtension MpaddedExtension MpathExtension MphantomExtension MprescriptsExtension MrootExtension MrowExtension MsExtension MspaceExtension MsqrtExtension MstyleExtension MsubExtension MsubsupExtension MsupExtension MtableExtension MtdExtension MtextExtension MtrExtension MunderExtension MunderoverExtension NavExtension NoscriptExtension ObjectExtension OlExtension OptgroupExtension OptionExtension OutputExtension PExtension ParamExtension PathExtension PatternExtension PictureExtension PointerInteraction A interaction that contains data about the pointer button(s) that triggered the event. PolygonExtension PolylineExtension PreExtension ProgressExtension Properties Every “Props” used for a component must implement the Properties
trait. This trait gives some hints to Dioxus
on how to memoize the props and some additional optimizations that can be made. We strongly encourage using the
derive macro to implement the Properties
trait automatically. QExtension RadialGradientExtension Readable A trait for states that can be read from like crate::Signal
, crate::GlobalSignal
, or crate::ReadOnlySignal
. You may choose to accept this trait as a parameter instead of the concrete type to allow for more flexibility in your API. For example, instead of creating two functions, one that accepts a crate::Signal
and one that accepts a crate::GlobalSignal
, you can create one function that accepts a Readable
type. ReadableOptionExt An extension trait for Readable<Option> that provides some convenience methods. ReadableResultExt An extension trait for Readable<Option> that provides some convenience methods. ReadableVecExt An extension trait for Readable<Vec> that provides some convenience methods. RectExtension RenderedElementBacking An Element that has been rendered and allows reading and modifying information about it. Routable The Routable trait is implemented for types that can be converted to and from a route and be rendered as a page. RpExtension RtExtension RubyExtension SExtension SampExtension ScriptExtension SectionExtension SelectExtension SemanticsExtension SetExtension SlotExtension SmallExtension SourceExtension SpanExtension StopExtension Storage A trait for a storage backing type. (RefCell, RwLock, etc.) StrongExtension StyleExtension SubExtension SummaryExtension SupExtension SuperFrom A enhanced version of the From
trait that allows with more flexibility. SuperInto A enhanced version of the Into
trait that allows with more flexibility. SuspenseExtension Provides context methods to Result<T, RenderError>
to show loading indicators for suspended results SvgAttributesExtension SvgExtension SwitchExtension SymbolExtension TableExtension TbodyExtension TdExtension TemplateExtension TextExtension TextPathExtension TextareaExtension TfootExtension ThExtension TheadExtension TimeExtension TitleExtension ToRouteSegments Something that can be converted into multiple route segments. This must be implemented for any type that is spread into the route segment like #[route("/:..route_segments")]
. TrExtension TrackExtension TspanExtension UExtension UlExtension UseExtension VarExtension VideoExtension ViewExtension WbrExtension Writable A trait for states that can be written to like crate::Signal
. You may choose to accept this trait as a parameter instead of the concrete type to allow for more flexibility in your API. WritableOptionExt An extension trait for Writable<Option<T>>
` that provides some convenience methods. WritableVecExt An extension trait for Writable<Vec<T>>
that provides some convenience methods. ErrorBoundary Create a new error boundary component that catches any errors thrown from child components Fragment Create inline fragments using Component syntax. GoBackButton A button to go back through the navigation history. Similar to a browsers back button. GoForwardButton A button to go forward through the navigation history. Similar to a browsers forward button. Link A link to navigate to another route. Outlet An outlet for the current content. Router A component that renders the current route. SuspenseBoundary Suspense Boundaries let you render a fallback UI while a child component is suspended. consume_context Consume context from the current scope consume_context_from_scope Consume context from the current scope current_owner Returns the current owner. This owner will be used to drop any Copy
state that is created by the generational-box
crate. current_scope_id Get the current scope id fc_to_builder This utility function launches the builder method so that the rsx! macro can use the typed-builder pattern
to initialize a component’s props. generation Get the current render since the inception of this component get_global_context Get the global context for signals has_context Check if the current scope has a context history Get the history provider for the current platform if the platform doesn’t implement a history functionality. launch navigator Acquire the navigator without subscribing to updates. needs_update Mark the current scope as dirty, causing it to re-render needs_update_any Mark the current scope as dirty, causing it to re-render onabort abort onanimationend onanimationend onanimationiteration onanimationiteration onanimationstart onanimationstart onblur onblur oncanplay canplay oncanplaythrough canplaythrough onchange onchange onclick Execute a callback when a button is clicked. oncompositionend oncompositionend oncompositionstart oncompositionstart oncompositionupdate oncompositionupdate oncontextmenu oncontextmenu oncopy oncopy oncut oncut ondblclick Deprecated
General Event Handler Information
ondoubleclick
General Event Handler Information
ondrag ondrag ondragend ondragend ondragenter ondragenter ondragexit ondragexit ondragleave ondragleave ondragover ondragover ondragstart ondragstart ondrop ondrop ondurationchange durationchange onemptied emptied onencrypted encrypted onended ended onerror onerror onfocus onfocus onfocusin
General Event Handler Information
onfocusout
General Event Handler Information
ongotpointercapture gotpointercapture oninput The oninput
event is fired when the value of a <input>
, <select>
, or <textarea>
element is changed. oninvalid oninvalid onkeydown onkeydown onkeypress onkeypress onkeyup onkeyup onload onload onloadeddata loadeddata onloadedmetadata loadedmetadata onloadstart loadstart onlostpointercapture lostpointercapture onmounted The onmounted event is fired when the element is first added to the DOM. This event gives you a MountedData
object and lets you interact with the raw DOM element. onmousedown onmousedown onmouseenter onmouseenter onmouseleave onmouseleave onmousemove onmousemove onmouseout onmouseout onmouseover onmouseover onmouseup onmouseup onpaste onpaste onpause pause onplay play onplaying playing onpointercancel pointercancel onpointerdown pointerdown onpointerenter pointerenter onpointerleave pointerleave onpointermove pointermove onpointerout pointerout onpointerover pointerover onpointerup pointerup onprogress progress onratechange ratechange onreset onreset onresize onresize onscroll onscroll onseeked seeked onseeking seeking onselect select onselectionchange selectionchange onselectstart selectstart onstalled stalled onsubmit onsubmit onsuspend suspend ontimeupdate timeupdate ontoggle ontoggle ontouchcancel touchcancel ontouchend touchend ontouchmove touchmove ontouchstart touchstart ontransitionend transitionend onvisible onvisible onvolumechange volumechange onwaiting waiting onwheel Called when the mouse wheel is rotated over an element. parent_scope Get the parent of the current scope if it exists provide_context Provide context to the current scope provide_error_boundary Provide an error boundary to catch errors from child components provide_root_context Provide a context to the root scope queue_effect Queue an effect to run after the next render. You generally shouldn’t need to interact with this function directly. use_effect will call this function for you. remove_future Informs the scheduler that this task is no longer needed and should be removed. root_router Try to get the router that was created closest to the root of the virtual dom. This may be called outside of the router. router Acquire the router without subscribing to updates. schedule_update Schedule an update for the current component schedule_update_any Schedule an update for any component given its ScopeId
. set_event_converter spawn Spawns the future but does not return the Task
. This task will automatically be canceled when the component is dropped. spawn_forever Spawn a future that Dioxus won’t clean up when this component is unmounted spawn_isomorphic Start a new future on the same thread as the rest of the VirtualDom. suspend Suspended the current component on a specific task and then return None throw_error Throw a CapturedError
into the current scope. The error will bubble up to the nearest crate::prelude::ErrorBoundary()
or the root of the app. try_consume_context Consume context from the current scope try_router Try to acquire the router without subscribing to updates. try_use_context Consume some context in the tree, providing a sharable handle to the value use_after_render Push this function to be run after the next render use_before_render A hook that allows you to insert a “before render” function. use_callback Create a callback that’s always up to date. Whenever this hook is called the inner callback will be replaced with the new callback but the handle will remain. use_context Consume some context in the tree, providing a sharable handle to the value use_context_provider Provide some context via the tree and return a reference to it use_coroutine Maintain a handle over a future that can be paused, resumed, and canceled. use_coroutine_handle Get a handle to a coroutine higher in the tree
Analogous to use_context_provider and use_context,
but used for coroutines specifically
See the docs for use_coroutine
for more details. use_drop Creates a callback that will be run before the component is removed.
This can be used to clean up side effects from the component
(created with use_effect
). use_effect Effects are reactive closures that run after the component has finished rendering . Effects are useful for things like manually updating the DOM after it is rendered with web-sys or javascript. Or reading a value from the rendered DOM. use_future A hook that allows you to spawn a future the first time you render a component. use_hook Store a value between renders. The foundational hook for all other hooks. use_hook_did_run A hook that uses before/after lifecycle hooks to determine if the hook was run use_hook_with_cleanup Use a hook with a cleanup function use_memo Creates a new Memo. The memo will be run immediately and whenever any signal it reads is written to. Memos can be used to efficiently compute derived data from signals. use_navigator A hook that provides access to the navigator to change the router history. use_on_unmount Deprecated use_reactive Takes some non-reactive data, and a closure and returns a closure that will subscribe to that non-reactive data as if it were reactive. use_resource use_resource()
is a reactive hook that resolves to the result of a future. It will rerun when you write to any signals you read inside the future.use_root_context Try to get a value from the root of the virtual dom, if it doesn’t exist, create a new one with the closure provided. use_route A hook that provides access to information about the current routing location. use_router Deprecated A hook that provides access to information about the router. use_set_compare Creates a new SetCompare which efficiently tracks when a value changes to check if it is equal to a set of values. use_set_compare_equal A hook that returns true if the value is equal to the value in the set compare. use_signal Creates a new Signal. Signals are a Copy state management solution with automatic dependency tracking. use_signal_sync Creates a new `Send + Sync`` Signal. Signals are a Copy state management solution with automatic dependency tracking. with_owner Run a closure with the given owner. AnimationEvent ClipboardEvent Component A Component
is a function that takes Properties
and returns an Element
. CompositionEvent ContextFn A context function is a Send and Sync closure that returns a boxed trait object DragEvent Element An Element
is a possibly-none VNode
created by calling render
on ScopeId
or ScopeState
. EventHandler The callback type generated by the rsx!
macro when an on
field is specified for components. FocusEvent FormEvent GlobalMemo A memo that can be accessed from anywhere in the application and created in a static GlobalSignal A signal that can be accessed from anywhere in the application and created in a static ImageEvent KeyboardEvent LaunchFn MediaEvent MountedEvent MountedResult The MountedResult type for the MountedData MouseEvent PointerEvent A synthetic event that wraps a web-style PointerEvent
ReadSignal A signal that can only be read from. ReadableRef A reference to a value that can be read from. ResizeEvent ResizeResult The ResizeResult type for the ResizeData ScrollEvent SelectionEvent SyncSignal A signal that can safely shared between threads. ToggleEvent TouchEvent TransitionEvent VisibleEvent VisibleResult The VisibleResult type for the VisibleData WheelEvent A synthetic event that wraps a web-style
WheelEvent
WritableRef A reference to a value that can be read from. component Component Props Props Routable Derives the Routable trait for an enum of routes