1
0
Jonathan Kelley cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
..
PWA-example 6ed3aafb2f Get cargo check --all working 1 жил өмнө
assets cfc119cce2 Update more examples, add css for more examples 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 3270f7341a fix manganis support for dioxus desktop 1 жил өмнө
README.md ee25c03e74 fix some clippy lints 1 жил өмнө
all_events.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
backgrounded_futures.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
calculator.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
calculator_mutable.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
clock.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
control_focus.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
counters.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
crm.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
custom_assets.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
custom_html.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
disabled.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
dog_app.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
dynamic_asset.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
error_handle.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
eval.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
file_explorer.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
file_upload.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
flat_router.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
form.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
future.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
generic_component.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
global.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
hello_world.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
hydration.rs 85c7c22619 Make router work on web 1 жил өмнө
link.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
login_form.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
memo_chain.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
multiwindow.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
nested_listeners.rs 3ded0f5329 Make more examples cross-platform 1 жил өмнө
optional_props.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
overlay.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
popup.rs bdbae8ccb0 Update examples, add css 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 cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
readme.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
reducer.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
router.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
rsx_usage.rs e65c5f0eb3 depreciate the render macro 1 жил өмнө
scroll_to_top.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
shortcut.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
shorthand.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
signals.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
simple_list.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
simple_router.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
spread.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
ssr.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
streams.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
suspense.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
svg.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
todomvc.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
video_stream.rs cfc119cce2 Update more examples, add css for more examples 1 жил өмнө
web_component.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
window_event.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
window_focus.rs bdbae8ccb0 Update examples, add css 1 жил өмнө
window_zoom.rs bdbae8ccb0 Update examples, add css 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