Jonathan Kelley c0522bc152 cargo check all hai 1 ano
..
PWA-example 6ed3aafb2f Get cargo check --all working hai 1 ano
assets 8918bf9463 Make the calculator more beautiful hai 1 ano
mobile_demo 85c7c22619 Make router work on web hai 1 ano
openid_connect_demo 85c7c22619 Make router work on web hai 1 ano
tailwind e65c5f0eb3 depreciate the render macro hai 1 ano
README.md ee25c03e74 fix some clippy lints hai 1 ano
all_events.rs 06d9b575b7 rename use_selector to use_memo hai 1 ano
calculator.rs 06d9b575b7 rename use_selector to use_memo hai 1 ano
clock.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
compose.rs 85c7c22619 Make router work on web hai 1 ano
control_focus.rs e65c5f0eb3 depreciate the render macro hai 1 ano
counter.rs 028f499bf6 Fix generational box in release mode hai 1 ano
crm.rs f2e48f10e9 simplify the crm example a bit more hai 1 ano
custom_assets.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
custom_html.rs 85c7c22619 Make router work on web hai 1 ano
disabled.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
dog_app.rs 028f499bf6 Fix generational box in release mode hai 1 ano
dynamic_asset.rs e9978c119f Don't strip the prefix from custom assets hai 1 ano
error_handle.rs e65c5f0eb3 depreciate the render macro hai 1 ano
eval.rs c0522bc152 cargo check all hai 1 ano
file_explorer.rs 85c7c22619 Make router work on web hai 1 ano
file_upload.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
filedragdrop.rs 85c7c22619 Make router work on web hai 1 ano
flat_router.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
form.rs e65c5f0eb3 depreciate the render macro hai 1 ano
generic_component.rs e65c5f0eb3 depreciate the render macro hai 1 ano
global.rs 06d9b575b7 rename use_selector to use_memo hai 1 ano
hello_world.rs 83bce6ce97 Make cargo check --all --examples work! hai 1 ano
hydration.rs 85c7c22619 Make router work on web hai 1 ano
inputs.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
link.rs 85c7c22619 Make router work on web hai 1 ano
login_form.rs e65c5f0eb3 depreciate the render macro hai 1 ano
multiwindow.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
nested_listeners.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
optional_props.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
overlay.rs 85c7c22619 Make router work on web hai 1 ano
pattern_model.rs 85c7c22619 Make router work on web hai 1 ano
pattern_reducer.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
query_segments.rs 552ce92c64 Don't make query_segments special hai 1 ano
read_size.rs 83bce6ce97 Make cargo check --all --examples work! hai 1 ano
readme.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
router.rs 85c7c22619 Make router work on web hai 1 ano
rsx_usage.rs e65c5f0eb3 depreciate the render macro hai 1 ano
scroll_to_top.rs e65c5f0eb3 depreciate the render macro hai 1 ano
shortcut.rs 85c7c22619 Make router work on web hai 1 ano
shorthand.rs e65c5f0eb3 depreciate the render macro hai 1 ano
signals.rs c0522bc152 cargo check all hai 1 ano
simple_list.rs e65c5f0eb3 depreciate the render macro hai 1 ano
simple_router.rs 85c7c22619 Make router work on web hai 1 ano
spread.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
ssr.rs e65c5f0eb3 depreciate the render macro hai 1 ano
streams.rs 85c7c22619 Make router work on web hai 1 ano
suspense.rs 85c7c22619 Make router work on web hai 1 ano
svg.rs 06d9b575b7 rename use_selector to use_memo hai 1 ano
tasks.rs e65c5f0eb3 depreciate the render macro hai 1 ano
textarea.rs e65c5f0eb3 depreciate the render macro hai 1 ano
todomvc.rs 06d9b575b7 rename use_selector to use_memo hai 1 ano
video_stream.rs 85c7c22619 Make router work on web hai 1 ano
web_component.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
window_event.rs 85c7c22619 Make router work on web hai 1 ano
window_focus.rs 3ded0f5329 Make more examples cross-platform hai 1 ano
window_zoom.rs 85c7c22619 Make router work on web hai 1 ano
xss_safety.rs e65c5f0eb3 depreciate the render macro hai 1 ano

README.md

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