Module prelude

Module prelude 

Source
Available on crate feature prelude only.

Re-exports§

pub use dioxus_core;
pub use dioxus_core::SuspenseBoundary;
pub use dioxus_html as dioxus_elements;
pub use dioxus_html::keyboard_types;
pub use manganis;
pub use dioxus_signals;
pub use dioxus_stores;
pub use dioxus_document as document;

Modules§

global_attributes
svg_attributes
warnings
Warnings that can be triggered by suspicious usage of signals

Macros§

asset
The asset macro collects assets that will be included in the final binary
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
eq_impls
This macro is used to generate impl PartialEq blocks for any Readable type that takes a generic T
fmt_impls
This macro is used to generate impl Display, and impl Debug blocks for any Readable type that takes a generic T
option_asset
Resolve an asset at compile time, returning None if the asset does not exist.
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.
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
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

Structs§

Action
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
AssetOptions
Settings for a generic asset
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. 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.
CancelData
ClipboardData
CompositionData
CopyValue
CopyValue is a wrapper around a value to make the value mutable and Copy.
Coroutine
CssAssetOptions
Options for a css asset
Dispatching
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 a folder asset.
FormData
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
ImageAssetOptions
Options for an image asset
ImageData
JsAssetOptions
Options for a javascript asset
KeyboardData
MappedMutSignal
A read only signal that has been mapped to a new type.
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
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
ReadSignal
A boxed version of Readable that can be used to store any readable type.
ReadableValueIterator
An iterator over the values of a Readable<Vec<T>>.
ResizeData
Resource
A handle to a reactive future spawned with use_resource that can be used to modify or read the result of the future.
ScopeId
A component’s unique identifier.
ScrollData
ScrollToOptions
The way that scrolling should be performed
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.
Store
Stores are a reactive type built for nested data structures. Each store will lazily create signals for each field/member of the data structure as needed.
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.
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
UseWaker
VNode
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>>.
WriteLock
A mutable reference to a writable 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.
WriteSignal
A boxed version of Writable that can be used to store any writable type.

Enums§

AssetVariant
Settings for a specific type of 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.
FormValue
A value in a form, either text or a file
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
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
ScrollLogicalPosition
The desired final position within the scrollable ancestor container for a given axis.
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

Traits§

AExtension
AbbrExtension
ActionCallback
AddressExtension
AnimateExtension
AnimateMotionExtension
AnimateTransformExtension
AnnotationExtension
AnnotationXmlExtension
AnyStorage
A trait for any storage backing type.
AnyhowContext
Provides the context method for Result.
AreaExtension
ArticleExtension
AsideExtension
AudioExtension
BExtension
BaseExtension
BdiExtension
BdoExtension
BlockquoteExtension
BodyExtension
BoxedSignalStorage
A trait for creating boxed readable and writable signals. This is implemented for UnsyncStorage and SyncStorage.
BrExtension
ButtonExtension
CanvasExtension
CaptionExtension
CircleExtension
CiteExtension
ClipPathExtension
CodeExtension
ColExtension
ColgroupExtension
CreateBoxedSignalStorage
A trait for creating boxed readable and writable signals. This is implemented for UnsyncStorage and SyncStorage.
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
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
HasCancelData
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.
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
QExtension
RadialGradientExtension
Readable
A trait for states that can be read from like crate::Signal, crate::GlobalSignal, or crate::ReadSignal. 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.
ReadableBoxExt
An extension trait for Readable types that can be boxed into a trait object.
ReadableExt
An extension trait for Readable types that provides some convenience methods.
ReadableHashMapExt
An extension trait for Readable<HashMap<K, V, H>> that provides some convenience methods.
ReadableHashSetExt
An extension trait for Readable<HashSet<V, H>> that provides some convenience methods.
ReadableOptionExt
An extension trait for Readable<Option<T>> that provides some convenience methods.
ReadableResultExt
An extension trait for Readable<Option<T>> that provides some convenience methods.
ReadableStrExt
An extension trait for Readable<String> and Readable<str> that provides some convenience methods.
ReadableStringExt
An extension trait for Readable<String> that provides some convenience methods.
ReadableVecExt
An extension trait for Readable<Vec<T>> that provides some convenience methods.
RectExtension
RenderedElementBacking
An Element that has been rendered and allows reading and modifying information about it.
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
SvgAttributesExtension
SvgExtension
SwitchExtension
SymbolExtension
TableExtension
TbodyExtension
TdExtension
TemplateExtension
TextExtension
TextPathExtension
TextareaExtension
TfootExtension
ThExtension
TheadExtension
TimeExtension
TitleExtension
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.
WritableBoxedExt
An extension trait for Writable values that can be boxed into a trait object.
WritableExt
An extension trait for Writable that provides some convenience methods.
WritableHashMapExt
An extension trait for Writable<HashMap<K, V, H>> that provides some convenience methods.
WritableHashSetExt
An extension trait for Writable<HashSet<V, H>> that provides some convenience methods.
WritableOptionExt
An extension trait for Writable<Option<T>>` that provides some convenience methods.
WritableStringExt
An extension trait for Writable<String> that provides some convenience methods.
WritableVecExt
An extension trait for Writable<Vec<T>> that provides some convenience methods.

Functions§

ErrorBoundary
Create a new error boundary component that catches any errors thrown from child components
Fragment
Create inline fragments using Component syntax.
Meta
Render a <meta> tag into the head of the page.
Stylesheet
Render a <link> tag into the head of the page with the stylesheet rel. This is equivalent to the Link component with a slightly more ergonomic API.
SuspenseBoundary
Suspense Boundaries let you render a fallback UI while a child component is suspended.
Title
Render the title of the page. On web renderers, this will set the <title> in the head. On desktop, it will set the window title.
consume_context
Consume context from the current scope
get_global_context
Get the global context for signals
history
Get the history provider for the current platform if the platform doesn’t implement a history functionality.
onabort
abort
onanimationend
onanimationend
onanimationiteration
onanimationiteration
onanimationstart
onanimationstart
onauxclick
auxclick
onbeforetoggle
onbeforetoggle
onblur
onblur
oncancel
oncancel
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
ondblclickDeprecated
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
onmount
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.
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
onscrollend
onscrollend
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.
provide_context
Provide context to the current scope
set_event_converter
spawn
Spawns the future and returns the Task. This task will automatically be canceled when the component is dropped.
suspend
Suspended the current component on a specific task and then return None
try_consume_context
Consume context from the current scope
try_use_context
Consume some context in the tree, providing a sharable handle to the value
use_action
use_after_suspense_resolved
Run a closure after the suspense boundary this is under is resolved. The closure will be run immediately if the suspense boundary is already resolved or the scope is not under a suspense boundary.
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 utility lifecycle hook that is intended to be used inside other hooks to determine if the outer hook has ran this render. The provided callback is executed after each render. The value will only be true if the containing outer hook is executed.
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_on_unmountDeprecated
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_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.
use_store
Create a new Store. Stores are a reactive type built for nested data structures.
use_waker
A hook that provides a waker for other hooks to provide async/await capabilities.

Type Aliases§

AnimationEvent
CancelEvent
ClipboardEvent
Component
A Component is a function that takes Properties and returns an Element.
CompositionEvent
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
GlobalStore
A type alias for global stores
ImageEvent
KeyboardEvent
MediaEvent
MountedEvent
MountedResult
The MountedResult type for the MountedData
MouseEvent
PointerEvent
A synthetic event that wraps a web-style PointerEvent
ReadOnlySignalDeprecated
A signal that can only be read from.
ReadStore
A type alias for a boxed read-only store.
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 written to.
WriteStore
A type alias for a boxed writable-only store.

Attribute Macros§

component
Component
css_module
Generate type-safe styles with scoped CSS class names.
store
#[store]

Derive Macros§

Props
Props
Store
derive(Store)