This macro is used to generate a impl Default
block for any type with the function new_maybe_sync that takes a generic T
This macro is used to generate impl PartialEq
blocks for any Readable type that takes a generic T
This macro is used to generate impl Display
, and impl Debug
blocks for any Readable type that takes a generic T
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
The rsx! macro makes it easy for developers to write jsx-style markup in their components.
A helper macro for cloning multiple values at once
A helper macro for use_reactive
that merges uses the closure syntax to elaborate the dependency array
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
An attribute on a DOM node, such as id="my-thing"
or href="https://example.com"
The callback type generated by the rsx!
macro when an on
field is specified for components.
CopyValue is a wrapper around a value to make the value mutable and Copy.
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.
A handle to an effect.
A context with information about suspended components
A wrapper around some generic data that handles the event’s state
A form value that may either be a list of values or a single value
A lazy value that is created once per application and can be accessed from anywhere in that application
A key used to identify a signal in the global signal context
The context for global signals
A read only signal that has been mapped to a new type.
Memos are the result of computing a value from use_memo
.
Pressed modifier keys.
An Element that has been rendered and allows reading and modifying information about it.
A synthetic event that wraps a web-style
MouseEvent
Data associated with a mouse event
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.
A platform specific event.
Reactivity
A signal that can only be read from.
An iterator over the values of a Readable<Vec<T>>
.
A handle to a reactive future spawned with
use_resource
that can be used to modify or read the result of the future.
A global runtime that is shared across all scopes that provides the async runtime and context API
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.
A component’s unique identifier.
A component’s rendered state.
An object that can efficiently compare a value to a set of values.
Signals are a Copy state management solution with automatic dependency tracking.
The data stored for tracking in a signal.
A task that has been suspended which may have an optional loading placeholder
A context with information about suspended components
A thread safe storage. This is slower than the unsync storage, but allows you to share the value between threads.
A task’s unique identifier.
A static layout of a UI tree that describes a set of dynamic and static nodes.
The receiving end of an unbounded mpsc channel.
The transmission end of an unbounded mpsc channel.
A unsync storage. This is the default storage type.
A reference to a template along with any context needed to hydrate it
A reference to a template along with any context needed to hydrate it
A virtual node system that progresses user events and diffs UI trees.
A mutable reference to a signal’s value.
An error that can occur when trying to borrow a value.
An error that can occur when trying to borrow a value mutably.
Code is the physical position of a key.
Key represents the meaning of a keypress.
The location attribute contains an indication of the logical location
of the key on the device.
The error type for the MountedData
An error that can occur while rendering a component
The error type for the MountedData
The way that scrolling should be performed
An attribute of the TemplateNode, created at compile time
A statically known node in a layout.
A signal that represents the state of a future
A signal that represents the state of the resource
A trait for any storage backing type.
Any component that implements the ComponentFn
trait can be used as a component.
A dependency is a trait that can be used to determine if a effect or selector should be re-run.
A dependency is a trait that can be used to determine if a effect or selector should be re-run.
A trait for any object that has the data for an animation event
A trait for anything that has a dynamic list of attributes
A trait for any object that has the data for a composition event
A trait for any object that has the data for a drag event
An object that has all the data for a form event
A trait for any object that has the data for an image event
A trait for any object that has the data for a mouse event
A trait for any object that has the data for a pointer event
A trait for touch point data
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.
A trait for an item that can be constructed from an initialization function
A interaction that contains data about the location of the event.
A interaction that contains data about the location of the event.
A value that can be converted into an attribute value
A trait that allows various items to be converted into a dynamic node for the rsx macro
A interaction that contains data about the current state of the keyboard modifiers.
A interaction that contains data about the pointer button(s) that triggered the event.
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.
An extension trait for Readable<Option> that provides some convenience methods.
An extension trait for Readable<Option> that provides some convenience methods.
An extension trait for Readable<Vec> that provides some convenience methods.
An Element that has been rendered and allows reading and modifying information about it.
A trait for a storage backing type. (RefCell, RwLock, etc.)
A enhanced version of the From
trait that allows with more flexibility.
A enhanced version of the Into
trait that allows with more flexibility.
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.
Create a new error boundary component that catches any errors thrown from child components
Create inline fragments using Component syntax.
Suspense Boundaries let you render a fallback UI while a child component is suspended.
Consume context from the current scope
Consume context from the current scope
Returns the current owner. This owner will be used to drop any Copy
state that is created by the generational-box
crate.
Get the current scope id
This utility function launches the builder method so rsx! and html! macros can use the typed-builder pattern
to initialize a component’s props.
Get the current render since the inception of this component
Get the global context for signals
Check if the current scope has a context
Mark the current scope as dirty, causing it to re-render
Mark the current scope as dirty, causing it to re-render
abort
onanimationend
onanimationiteration
onanimationstart
onblur
canplay
canplaythrough
onchange
Execute a callback when a button is clicked.
oncompositionend
oncompositionstart
oncompositionupdate
oncontextmenu
oncopy
oncut
General Event Handler Information
General Event Handler Information
ondrag
ondragend
ondragenter
ondragexit
ondragleave
ondragover
ondragstart
ondrop
durationchange
emptied
encrypted
ended
onerror
onfocus
General Event Handler Information
General Event Handler Information
gotpointercapture
The oninput
event is fired when the value of a <input>
, <select>
, or <textarea>
element is changed.
oninvalid
onkeydown
onkeypress
onkeyup
onload
loadeddata
loadedmetadata
loadstart
lostpointercapture
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
onmouseenter
onmouseleave
onmousemove
onmouseout
onmouseover
onmouseup
onpaste
pause
play
playing
pointercancel
pointerdown
pointerenter
pointerleave
pointermove
pointerout
pointerover
pointerup
progress
ratechange
onreset
onresize
onscroll
seeked
seeking
select
selectionchange
selectstart
stalled
onsubmit
suspend
timeupdate
ontoggle
touchcancel
touchend
touchmove
touchstart
transitionend
volumechange
waiting
Called when the mouse wheel is rotated over an element.
Get the parent of the current scope if it exists
Provide context to the current scope
Provide an error boundary to catch errors from child components
Provide a context to the root scope
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.
Informs the scheduler that this task is no longer needed and should be removed.
Schedule an update for the current component
Schedule an update for any component given its
ScopeId
.
Spawns the future but does not return the
Task
. This task will automatically be canceled when the component is dropped.
Spawn a future that Dioxus won’t clean up when this component is unmounted
Start a new future on the same thread as the rest of the VirtualDom.
Suspended the current component on a specific task and then return None
Consume context from the current scope
Consume some context in the tree, providing a sharable handle to the value
Push this function to be run after the next render
A hook that allows you to insert a “before render” function.
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.
Consume some context in the tree, providing a sharable handle to the value
Provide some context via the tree and return a reference to it
Maintain a handle over a future that can be paused, resumed, and canceled.
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.
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
).
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.
A hook that allows you to spawn a future the first time you render a component.
Store a value between renders. The foundational hook for all other hooks.
A hook that uses before/after lifecycle hooks to determine if the hook was run
Use a hook with a cleanup function
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.
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()
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.
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.
Creates a new SetCompare which efficiently tracks when a value changes to check if it is equal to a set of values.
A hook that returns true if the value is equal to the value in the set compare.
Creates a new Signal. Signals are a Copy state management solution with automatic dependency tracking.
Creates a new `Send + Sync`` Signal. Signals are a Copy state management solution with automatic dependency tracking.
Run a closure with the given owner.