dioxus/examples
2024-03-18 22:38:33 -07:00
..
assets clippy, and don't hash invisible files for ts generation 2024-03-05 22:38:38 -08:00
mobile_demo Fix: update wry, tao, to fix android issues 2024-03-15 20:12:13 -07:00
openid_connect_demo added hot-reload as config option with default to true (#2024) 2024-03-08 14:54:03 -06:00
PWA-example fix: some simple formatting and version numbers 2024-02-21 14:32:19 -08:00
tailwind add gitignore to tailwind 2024-02-22 08:53:37 -08:00
all_events.rs Make clippy happy on examples 2024-02-14 13:50:10 -08:00
backgrounded_futures.rs Update examples, add css 2024-02-14 12:33:07 -08:00
calculator.rs Update examples, add css 2024-02-14 12:33:07 -08:00
calculator_mutable.rs Update examples, add css 2024-02-14 12:33:07 -08:00
clock.rs Update examples, add css 2024-02-14 12:33:07 -08:00
control_focus.rs Update examples, add css 2024-02-14 12:33:07 -08:00
counters.rs Update examples, add css 2024-02-14 12:33:07 -08:00
crm.rs Update examples, add css 2024-02-14 12:33:07 -08:00
custom_assets.rs Update examples, add css 2024-02-14 12:33:07 -08:00
custom_html.rs Update examples, add css 2024-02-14 12:33:07 -08:00
custom_menu.rs Add a menu bar option to the desktop config (#2107) 2024-03-18 22:36:47 -07:00
disabled.rs Update examples, add css 2024-02-14 12:33:07 -08:00
dog_app.rs restore lifetime checking for signals 2024-03-08 10:32:57 -06:00
dynamic_asset.rs Update examples, add css 2024-02-14 12:33:07 -08:00
error_handle.rs Make Clippy happy 2024-03-15 12:20:16 -07:00
eval.rs Eval should never return an error 2024-02-14 15:13:15 -08:00
file_explorer.rs Update examples, add css 2024-02-14 12:33:07 -08:00
file_upload.rs cfg out globalhotkey 2024-03-06 16:42:45 -08:00
flat_router.rs Update examples, add css 2024-02-14 12:33:07 -08:00
form.rs Fix #2043: use formvalue instead of String for forms (#2103) 2024-03-18 18:21:08 -07:00
future.rs Fix error in examples/future.rs comments, use_futures inline docs comments, also added clarification that Signal<T>.read() and Singal<T>() are the same thing 2024-02-28 11:42:04 +08:00
generic_component.rs Update examples, add css 2024-02-14 12:33:07 -08:00
global.rs Update examples, add css 2024-02-14 12:33:07 -08:00
hello_world.rs Update examples, add css 2024-02-14 12:33:07 -08:00
hydration.rs Make router work on web 2024-01-19 16:36:40 -08:00
image_generator_openai.rs clean up some examples, ensuring stuff works 2024-03-06 19:50:07 -08:00
link.rs Update examples, add css 2024-02-14 12:33:07 -08:00
login_form.rs Update examples, add css 2024-02-14 12:33:07 -08:00
memo_chain.rs fix memo chain example 2024-03-06 11:42:31 -06:00
multiwindow.rs Update examples, add css 2024-02-14 12:33:07 -08:00
nested_listeners.rs Make more examples cross-platform 2024-01-20 00:11:55 -08:00
optional_props.rs Make clippy happy on examples 2024-02-14 13:50:10 -08:00
overlay.rs Make clippy happy on examples 2024-02-14 13:50:10 -08:00
popup.rs Update examples, add css 2024-02-14 12:33:07 -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 Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
README.md update readme to remove dead examples 2024-02-14 15:26:52 -08:00
readme.rs remove repetitive words (#2046) 2024-03-11 09:49:26 -05:00
reducer.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
router.rs Fix hydration 2024-03-06 12:19:59 -08:00
rsx_usage.rs Fix rsx_usage example 2024-02-14 14:00:07 -08:00
scroll_to_top.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
shortcut.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
shorthand.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
signals.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
simple_list.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
simple_router.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
spread.rs Fix #1938, allow explicit props 2024-03-18 15:34:46 -07:00
ssr.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
streams.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
suspense.rs restore lifetime checking for signals 2024-03-08 10:32:57 -06:00
svg.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
todomvc.rs clean up some examples, ensuring stuff works 2024-03-06 19:50:07 -08:00
video_stream.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
weather_app.rs clean up some examples, ensuring stuff works 2024-03-06 19:50:07 -08:00
web_component.rs Update examples, add css 2024-02-14 12:33:07 -08:00
window_event.rs Update examples, add css 2024-02-14 12:33:07 -08:00
window_focus.rs Reduce churn in window behavior 2024-03-18 22:38:33 -07:00
window_zoom.rs Update examples, add css 2024-02-14 12:33:07 -08:00
xss_safety.rs clean up some examples, ensuring stuff works 2024-03-06 19:50:07 -08: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

optional_props - Optional props

CSS

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

Async

login_form - Login endpoint example

suspense - Render placeholders while data is loading

tasks - Continuously run future

SVG

svg

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

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