dioxus/examples
Evan Almloff 6a0c1c392b
Improve documentation for the fullstack crate (#2952)
* improve documentation for the fullstack server context

* Add a section about axum integration to the crate root docs

* make serve_dioxus_application accept the cfg builder directly

* remove unused server_fn module

* improve fullstack config docs

* improve documentation for the server function macro

* fix axum router extension link

* Fix doc tests

* Fix launch builder

* Remove redundant server_only inside server function

* Fix isrg config path
2024-10-10 13:40:11 -07:00
..
assets Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-auth Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-desktop Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-hello-world Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-router Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-streaming Improve documentation for the fullstack crate (#2952) 2024-10-10 13:40:11 -07:00
mobile_demo update 0.4 doc links to 0.5 2024-03-27 20:42:07 -05:00
pwa Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
ssg-github-pages Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
ssg-router Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
ssg-simple Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
tailwind Fix #2378: CLI MSRV and add MSRV to CI (#2716) 2024-07-26 19:24:40 -05:00
all_events.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
backgrounded_futures.rs Use of async_std::task::sleep instead of tokio::time::sleep in examples (#2912) 2024-09-03 15:16:37 +00:00
calculator.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
calculator_mutable.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
clock.rs Use of async_std::task::sleep instead of tokio::time::sleep (#2939) 2024-09-07 08:44:25 -05:00
control_focus.rs Use of async_std::task::sleep instead of tokio::time::sleep in examples (#2912) 2024-09-03 15:16:37 +00:00
counters.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
crm.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
custom_assets.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
custom_html.rs Check type of launch config (#2125) 2024-03-27 12:08:05 -07:00
custom_menu.rs Create use_muda_event_handler hook (#2367) 2024-04-25 13:32:34 -04:00
disabled.rs Update examples, add css 2024-02-14 12:33:07 -08:00
dog_app.rs Re-Export Manganis & Update Examples (#2625) 2024-07-23 10:29:37 -07:00
dynamic_asset.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
errors.rs Add space between rsx and exclamation point (#2956) 2024-09-13 08:31:39 -05:00
eval.rs Use of async_std::task::sleep instead of tokio::time::sleep in examples (#2912) 2024-09-03 15:16:37 +00:00
file_upload.rs Synchronous prevent default (#2792) 2024-08-13 11:57:54 -07:00
flat_router.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
form.rs fix most typos, add crate-ci/typos to CI (#2653) 2024-07-23 17:49:33 -07:00
future.rs Use of async_std::task::sleep instead of tokio::time::sleep in examples (#2912) 2024-09-03 15:16:37 +00:00
generic_component.rs set up example scaping for docs.rs (#2450) 2024-05-28 13:05:55 -07:00
global.rs Move to a generic GlobalLazy<T> (#2851) 2024-08-16 17:57:41 -05:00
hash_fragment_state.rs Implement hash fragments in the router (#2320) 2024-04-25 14:30:25 -04: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 Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
link.rs Synchronous prevent default (#2792) 2024-08-13 11:57:54 -07:00
login_form.rs chore: add the missing in comment (#2978) 2024-09-19 19:56:47 +00:00
memo_chain.rs set up example scaping for docs.rs (#2450) 2024-05-28 13:05:55 -07:00
meta.rs switch to a Document trait and introduce Script/Head/Style/Meta components (#2635) 2024-07-17 20:54:03 -05:00
multiwindow.rs fix most typos, add crate-ci/typos to CI (#2653) 2024-07-23 17:49:33 -07:00
nested_listeners.rs chore: fix some typos in comments (#2340) 2024-04-19 08:29:22 -05:00
optional_props.rs fix most typos, add crate-ci/typos to CI (#2653) 2024-07-23 17:49:33 -07:00
overlay.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
popup.rs Fix restarting coroutines (#3005) 2024-10-03 18:48:26 -05:00
query_segment_search.rs Implement hash fragments in the router (#2320) 2024-04-25 14:30:25 -04:00
read_size.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
README.md File explorer example moved from examples to example-projects. (#3009) 2024-09-30 07:04:11 -05:00
readme.rs remove repetitive words (#2046) 2024-03-11 09:49:26 -05:00
reducer.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
resize.rs Add the onresize event handler to Element (#2479) 2024-08-15 01:23:49 +00:00
router.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
router_resource.rs fix header docs in router_resource 2024-06-19 09:06:42 -07:00
rsx_usage.rs Fix: enable dangerous_inner_html for svgs (#2717) 2024-07-26 23:29:24 +00:00
scroll_to_top.rs set up example scaping for docs.rs (#2450) 2024-05-28 13:05:55 -07:00
shortcut.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
shorthand.rs Suspense boundaries/out of order streaming/anyhow like error handling (#2365) 2024-07-01 20:50:36 -07:00
signals.rs Use of async_std::task::sleep instead of tokio::time::sleep in examples (#2912) 2024-09-03 15:16:37 +00:00
simple_list.rs cut out a number of changes from the hr PR (#2580) 2024-07-02 17:09:57 -07:00
simple_router.rs Fix eventhandler optional (#2119) 2024-03-20 09:04:37 -07:00
spread.rs Extend head components with global attributes (#2888) 2024-10-01 10:24:22 -05:00
ssr.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
streams.rs Use of async_std::task::sleep instead of tokio::time::sleep in examples (#2912) 2024-09-03 15:16:37 +00:00
suspense.rs Suspense boundaries/out of order streaming/anyhow like error handling (#2365) 2024-07-01 20:50:36 -07:00
svg.rs Synchronous prevent default (#2792) 2024-08-13 11:57:54 -07:00
title.rs switch to a Document trait and introduce Script/Head/Style/Meta components (#2635) 2024-07-17 20:54:03 -05:00
todomvc.rs Simplify TodoMVC example (#2935) 2024-09-12 19:51:42 -05:00
video_stream.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
weather_app.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
web_component.rs fix most typos, add crate-ci/typos to CI (#2653) 2024-07-23 17:49:33 -07:00
window_event.rs Use head elements and new manganis syntax in examples (#2688) 2024-07-25 21:58:00 +00:00
window_focus.rs Reduce churn in window behavior 2024-03-18 22:38:33 -07:00
window_zoom.rs fix clippy on zoom example 2024-07-10 12:50:57 -07: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

file upload - Handle uploading 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

errors - 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

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