Skip to main content

Module prelude

Module prelude 

Source

Re-exports§

pub use crate as dioxus_elements;
pub use crate::Alignment;
pub use crate::Arrangement;
pub use crate::AssetKind;
pub use crate::Badge;
pub use crate::Badge;
pub use crate::Brush;
pub use crate::Button;
pub use crate::Button;
pub use crate::ButtonVariant;
pub use crate::Canvas;
pub use crate::Canvas;
pub use crate::Card;
pub use crate::Card;
pub use crate::Checkbox;
pub use crate::Checkbox;
pub use crate::Color;
pub use crate::ColorRole;
pub use crate::ColorScheme;
pub use crate::Column;
pub use crate::Column;
pub use crate::DatePicker;
pub use crate::DatePicker;
pub use crate::DesignSystem;
pub use crate::Dialog;
pub use crate::Dialog;
pub use crate::Divider;
pub use crate::Divider;
pub use crate::DrawCommand;
pub use crate::DrawList;
pub use crate::Dropdown;
pub use crate::Dropdown;
pub use crate::FileDrop;
pub use crate::FileDropTarget;
pub use crate::FileDropTarget;
pub use crate::Icon;
pub use crate::Icon;
pub use crate::IconRole;
pub use crate::Image;
pub use crate::Image;
pub use crate::Key;
pub use crate::KeyEvent;
pub use crate::LaunchBuilder;
pub use crate::LazyColumn;
pub use crate::LazyColumn;
pub use crate::LazyGrid;
pub use crate::LazyGrid;
pub use crate::LazyRow;
pub use crate::LazyRow;
pub use crate::LinearProgressIndicator;
pub use crate::LinearProgressIndicator;
pub use crate::LoopMode;
pub use crate::MaterialRole;
pub use crate::Menu;
pub use crate::Menu;
pub use crate::Message;
pub use crate::MessageDuration;
pub use crate::Modifier;
pub use crate::MotionRole;
pub use crate::Navigation;
pub use crate::Navigation;
pub use crate::NavigationItem;
pub use crate::NavigationItem;
pub use crate::Paint;
pub use crate::ProgressIndicator;
pub use crate::ProgressIndicator;
pub use crate::RadioButton;
pub use crate::RadioButton;
pub use crate::RangeRequest;
pub use crate::Row;
pub use crate::Row;
pub use crate::Scaffold;
pub use crate::Scaffold;
pub use crate::ScrollColumn;
pub use crate::ScrollColumn;
pub use crate::SelectionContainer;
pub use crate::SelectionContainer;
pub use crate::Separator;
pub use crate::Separator;
pub use crate::ShapeRole;
pub use crate::Sheet;
pub use crate::Sheet;
pub use crate::Slider;
pub use crate::Slider;
pub use crate::SpaceRole;
pub use crate::Spacer;
pub use crate::Spacer;
pub use crate::Stop;
pub use crate::Surface;
pub use crate::Surface;
pub use crate::Switch;
pub use crate::Switch;
pub use crate::Tabs;
pub use crate::Tabs;
pub use crate::Text;
pub use crate::Text;
pub use crate::TextAlign;
pub use crate::TextField;
pub use crate::TextField;
pub use crate::TextOverflow;
pub use crate::Theme;
pub use crate::TileMode;
pub use crate::TimePicker;
pub use crate::TimePicker;
pub use crate::Tooltip;
pub use crate::Tooltip;
pub use crate::TopAppBar;
pub use crate::TopAppBar;
pub use crate::TypeRole;
pub use crate::WindowHeightClass;
pub use crate::WindowSize;
pub use crate::WindowSizeClass;
pub use crate::asset;
pub use crate::asset;
pub use crate::brush;
pub use crate::brush;
pub use crate::launch;
pub use crate::show_message;
pub use crate::use_design_system;
pub use crate::use_node_size;
pub use crate::use_window_size;
pub use crate::schema::Chrome;
pub use crate::schema::Window;
pub use dioxus_core;
pub use dioxus_signals;

Modules§

warnings
Warnings that can be triggered by suspicious usage of signals

Macros§

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
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
A handle to an async action created by use_action.
Callback
The callback type generated by the rsx! macro when an on field is specified for components.
CopyValue
CopyValue is a wrapper around a value to make the value mutable and Copy.
Coroutine
Dispatching
Effect
A handle to an effect.
Event
A wrapper around some generic data that handles the event’s state
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
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.
Memo
Memos are the result of computing a value from use_memo.
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.
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>>.
Resource
A handle to a reactive future spawned with use_resource that can be used to modify or read the result of the future.
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.
SyncStorage
A thread safe storage. This is slower than the unsync storage, but allows you to share the value between threads.
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
VirtualDom
A virtual node system that progresses user events and diffs UI trees.
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§

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.
GlobalKey
A key used to identify a signal in the global signal context
UseFutureState
A signal that represents the state of a future
UseResourceState
A signal that represents the state of the resource

Traits§

ActionCallback
AnyStorage
A trait for any storage backing type.
BoxedSignalStorage
A trait for creating boxed readable and writable signals. This is implemented for UnsyncStorage and SyncStorage.
CreateBoxedSignalStorage
A trait for creating boxed readable and writable signals. This is implemented for UnsyncStorage and SyncStorage.
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.
InitializeFromFunction
A trait for an item that can be constructed from an initialization function
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.
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.
Storage
A trait for a storage backing type. (RefCell, RwLock, etc.)
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.
WritableResultExt
An extension trait for Writable<Result<T, E>> 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§

get_global_context
Get the global context for signals
try_use_context
Try to consume some context in the tree, returning None if it is not found.
use_action
Create an action that runs async work on demand, triggered by user interaction.
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, panicking if it is not found.
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_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_waker
A hook that provides a waker for other hooks to provide async/await capabilities.

Type Aliases§

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.
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
ReadOnlySignalDeprecated
A signal that can only be read from.
ReadableRef
A reference to a value that can be read from.
SyncSignal
A signal that can safely shared between threads.
WritableRef
A reference to a value that can be written to.

Attribute Macros§

component
Component

Derive Macros§

Props
Props