Jonathan Kelley 8f70a84c70 Use futures_util mutex instead of flume for sending flush lock wakeups 1 рік тому
..
PWA-example 6ed3aafb2f Get cargo check --all working 1 рік тому
assets 8918bf9463 Make the calculator more beautiful 1 рік тому
mobile_demo 85c7c22619 Make router work on web 1 рік тому
openid_connect_demo 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
tailwind e65c5f0eb3 depreciate the render macro 1 рік тому
README.md ee25c03e74 fix some clippy lints 1 рік тому
all_events.rs a14789eebc rename inner on event to data 1 рік тому
backgrounded_futures.rs 974680796f add test cases, refactor deref 1 рік тому
calculator.rs a72c035de4 Fix cargo check on examples 1 рік тому
calculator_mutable.rs 3a5cbae5ee Rename two files 1 рік тому
clock.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
compose.rs 85c7c22619 Make router work on web 1 рік тому
control_focus.rs a14789eebc rename inner on event to data 1 рік тому
counter.rs 028f499bf6 Fix generational box in release mode 1 рік тому
crm.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
custom_assets.rs 3ded0f5329 Make more examples cross-platform 1 рік тому
custom_html.rs 85c7c22619 Make router work on web 1 рік тому
disabled.rs 3ded0f5329 Make more examples cross-platform 1 рік тому
dog_app.rs 8f70a84c70 Use futures_util mutex instead of flume for sending flush lock wakeups 1 рік тому
dynamic_asset.rs e9978c119f Don't strip the prefix from custom assets 1 рік тому
error_handle.rs e65c5f0eb3 depreciate the render macro 1 рік тому
eval.rs 8f70a84c70 Use futures_util mutex instead of flume for sending flush lock wakeups 1 рік тому
file_explorer.rs 85c7c22619 Make router work on web 1 рік тому
file_upload.rs a14789eebc rename inner on event to data 1 рік тому
filedragdrop.rs 85c7c22619 Make router work on web 1 рік тому
flat_router.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
form.rs e65c5f0eb3 depreciate the render macro 1 рік тому
generic_component.rs e65c5f0eb3 depreciate the render macro 1 рік тому
global.rs 06d9b575b7 rename use_selector to use_memo 1 рік тому
hello_world.rs 83bce6ce97 Make cargo check --all --examples work! 1 рік тому
hydration.rs 85c7c22619 Make router work on web 1 рік тому
inputs.rs a14789eebc rename inner on event to data 1 рік тому
link.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
login_form.rs e65c5f0eb3 depreciate the render macro 1 рік тому
memo_chain.rs 8f07d881a6 Switch todo!() to unreachable!/unimplemented! where it matters 1 рік тому
multiwindow.rs 3ded0f5329 Make more examples cross-platform 1 рік тому
nested_listeners.rs 3ded0f5329 Make more examples cross-platform 1 рік тому
optional_props.rs 3ded0f5329 Make more examples cross-platform 1 рік тому
overlay.rs a72c035de4 Fix cargo check on examples 1 рік тому
query_segments.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
read_size.rs a14789eebc rename inner on event to data 1 рік тому
readme.rs 79501e43c1 revert readme example to the simple counter 1 рік тому
reducer.rs 3a5cbae5ee Rename two files 1 рік тому
router.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
rsx_usage.rs e65c5f0eb3 depreciate the render macro 1 рік тому
scroll_to_top.rs a14789eebc rename inner on event to data 1 рік тому
shortcut.rs 85c7c22619 Make router work on web 1 рік тому
shorthand.rs 8f07d881a6 Switch todo!() to unreachable!/unimplemented! where it matters 1 рік тому
signals.rs 8f70a84c70 Use futures_util mutex instead of flume for sending flush lock wakeups 1 рік тому
simple_list.rs 8f07d881a6 Switch todo!() to unreachable!/unimplemented! where it matters 1 рік тому
simple_router.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
spread.rs a72c035de4 Fix cargo check on examples 1 рік тому
ssr.rs 0bd9692e45 Fix cargo test and a number of little cleanup bugs 1 рік тому
stale_memo.rs 69f9bb6b65 Make benches compile 1 рік тому
streams.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
suspense.rs 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 1 рік тому
svg.rs a72c035de4 Fix cargo check on examples 1 рік тому
tasks.rs e65c5f0eb3 depreciate the render macro 1 рік тому
textarea.rs e65c5f0eb3 depreciate the render macro 1 рік тому
todomvc.rs 69f9bb6b65 Make benches compile 1 рік тому
video_stream.rs 85c7c22619 Make router work on web 1 рік тому
web_component.rs 3ded0f5329 Make more examples cross-platform 1 рік тому
window_event.rs 85c7c22619 Make router work on web 1 рік тому
window_focus.rs 69f9bb6b65 Make benches compile 1 рік тому
window_zoom.rs 85c7c22619 Make router work on web 1 рік тому
xss_safety.rs e65c5f0eb3 depreciate the render macro 1 рік тому

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