dioxus/examples
2024-01-31 16:56:58 -08:00
..
assets Make the calculator more beautiful 2024-01-17 19:01:28 -08:00
mobile_demo Make router work on web 2024-01-19 16:36:40 -08:00
openid_connect_demo Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
PWA-example Get cargo check --all working 2024-01-18 19:27:55 -08:00
tailwind depreciate the render macro 2024-01-16 13:18:46 -06:00
all_events.rs rename inner on event to data 2024-01-31 16:26:19 -08:00
backgrounded_futures.rs add test cases, refactor deref 2024-01-26 23:05:40 -08:00
calculator.rs Fix cargo check on examples 2024-01-30 17:59:57 -08:00
calculator_mutable.rs Rename two files 2024-01-23 17:00:49 -08:00
clock.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
compose.rs Make router work on web 2024-01-19 16:36:40 -08:00
control_focus.rs rename inner on event to data 2024-01-31 16:26:19 -08:00
counter.rs Fix generational box in release mode 2024-01-21 12:46:19 -08:00
crm.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
custom_assets.rs Make more examples cross-platform 2024-01-20 00:11:55 -08:00
custom_html.rs Make router work on web 2024-01-19 16:36:40 -08:00
disabled.rs Make more examples cross-platform 2024-01-20 00:11:55 -08:00
dog_app.rs use_future works 2024-01-31 16:56:58 -08:00
dynamic_asset.rs Don't strip the prefix from custom assets 2024-01-21 13:38:25 -08:00
error_handle.rs depreciate the render macro 2024-01-16 13:18:46 -06:00
eval.rs use_future works 2024-01-31 16:56:58 -08:00
file_explorer.rs Make router work on web 2024-01-19 16:36:40 -08:00
file_upload.rs rename inner on event to data 2024-01-31 16:26:19 -08:00
filedragdrop.rs Make router work on web 2024-01-19 16:36:40 -08:00
flat_router.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
form.rs depreciate the render macro 2024-01-16 13:18:46 -06:00
generic_component.rs depreciate the render macro 2024-01-16 13:18:46 -06:00
global.rs rename use_selector to use_memo 2024-01-20 23:32:12 -08:00
hello_world.rs Make cargo check --all --examples work! 2024-01-19 14:19:49 -08:00
hydration.rs Make router work on web 2024-01-19 16:36:40 -08:00
inputs.rs rename inner on event to data 2024-01-31 16:26:19 -08:00
link.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
login_form.rs depreciate the render macro 2024-01-16 13:18:46 -06:00
memo_chain.rs Switch todo!() to unreachable!/unimplemented! where it matters 2024-01-31 16:26:20 -08:00
multiwindow.rs Make more examples cross-platform 2024-01-20 00:11:55 -08:00
nested_listeners.rs Make more examples cross-platform 2024-01-20 00:11:55 -08:00
optional_props.rs Make more examples cross-platform 2024-01-20 00:11:55 -08:00
overlay.rs Fix cargo check on examples 2024-01-30 17:59:57 -08:00
query_segments.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
read_size.rs rename inner on event to data 2024-01-31 16:26:19 -08:00
README.md fix some clippy lints 2023-09-27 10:13:45 -05:00
readme.rs restore readme.rs 2024-01-29 13:37:00 -06:00
reducer.rs Rename two files 2024-01-23 17:00:49 -08:00
router.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
rsx_usage.rs depreciate the render macro 2024-01-16 13:18:46 -06:00
scroll_to_top.rs rename inner on event to data 2024-01-31 16:26:19 -08:00
shortcut.rs Make router work on web 2024-01-19 16:36:40 -08:00
shorthand.rs Switch todo!() to unreachable!/unimplemented! where it matters 2024-01-31 16:26:20 -08:00
signals.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
simple_list.rs Switch todo!() to unreachable!/unimplemented! where it matters 2024-01-31 16:26:20 -08:00
simple_router.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
spread.rs Fix cargo check on examples 2024-01-30 17:59:57 -08:00
ssr.rs Fix cargo test and a number of little cleanup bugs 2024-01-30 17:33:14 -08:00
stale_memo.rs Make benches compile 2024-01-30 18:29:49 -08:00
streams.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
suspense.rs Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
svg.rs Fix cargo check on examples 2024-01-30 17:59:57 -08:00
tasks.rs depreciate the render macro 2024-01-16 13:18:46 -06:00
textarea.rs depreciate the render macro 2024-01-16 13:18:46 -06:00
todomvc.rs Make benches compile 2024-01-30 18:29:49 -08:00
video_stream.rs Make router work on web 2024-01-19 16:36:40 -08:00
web_component.rs Make more examples cross-platform 2024-01-20 00:11:55 -08:00
window_event.rs Make router work on web 2024-01-19 16:36:40 -08:00
window_focus.rs Make benches compile 2024-01-30 18:29:49 -08:00
window_zoom.rs Make router work on web 2024-01-19 16:36:40 -08:00
xss_safety.rs depreciate the render macro 2024-01-16 13:18:46 -06:00

Examples

These examples are fully-fledged mini Dioxus apps.

You can run them with cargo run --example EXAMPLE_NAME. Example:

cargo run --example hello_world

(Most of these examples are run through webview, so you don't need the Dioxus CLI installed)

Basic Features

hello_world - Most basic example

readme - Counter example from the Readme

custom_assets - Include images

custom_html - Customize wrapper HTML

eval - Evaluate JS expressions

RSX

rsx_usage - Demo of all RSX features

xss_safety - You can include text without worrying about injections by default

Props

borrowed - Borrowed props

inlineprops - Demo of inline_props macro

optional_props - Optional props

CSS

all_css - You can specify any CSS attribute

tailwind - You can use a library for styling

Input Handling

all_events - Basic event handling demo

filedragdrop - Handle dropped files

form - Handle form submission

inputs - Input values

nested_listeners - Nested handlers and bubbling

textarea - Text area input

State Management

fermi - Fermi library for state management

pattern_reducer - The reducer pattern with use_state

rsx_compile_fail

Async

login_form - Login endpoint example

suspense - Render placeholders while data is loading

tasks - Continuously run future

SVG

svg_basic

svg

Performance

framework_benchmark - Renders a huge list

Note: The benchmark should be run in release mode:

cargo run --example framework_benchmark --release

heavy_compute - How to deal with expensive operations

Server-side rendering

ssr - Rendering RSX server-side

hydration - Pre-rendering with hydration

Common Patterns

disabled - Disable buttons conditionally

error_handle - Handle errors with early return

Routing

flat_router - Basic, flat route example

router - Router example

link - Internal, external and custom links

Platform Features

window_event - Window decorations, fullscreen, minimization, etc.

window_zoom Zoom in or out

Example Apps

calculator - Simple calculator

pattern_model - Simple calculator, but using a custom struct as the model

crm - Toy multi-page customer management app

dog_app - Accesses dog API

file_explorer - File browser that uses use_ref to interact with the model

todomvc - Todo task list example

TODO

Missing Features

  • Fine-grained reactivity
  • Refs - imperative handles to elements
  • Function-driven children: Pass functions to make VNodes

Missing examples

  • Shared state
  • Root-less element groups
  • Custom elements
  • Component Children: Pass children into child components
  • Render To string: Render a mounted virtualdom to a string
  • Testing and Debugging