dioxus/examples
2024-11-17 19:58:01 -05:00
..
assets Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-auth Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
fullstack-desktop Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
fullstack-hello-world Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
fullstack-router cli json output, dx bundle fix, dx serve --platform android, race condition, drop ssg platform (#3186) 2024-11-12 09:01:01 -05:00
fullstack-streaming cli json output, dx bundle fix, dx serve --platform android, race condition, drop ssg platform (#3186) 2024-11-12 09:01:01 -05:00
pwa clean up descriptions and hoist some dependencies 2024-11-16 12:55:20 -05:00
tailwind update readmes to reflect new versions 2024-11-17 19:58:01 -05:00
all_events.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
backgrounded_futures.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
calculator.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
calculator_mutable.rs Deprecate relative asset paths, better warnings for asset!() (#3214) 2024-11-13 19:52:23 -05:00
clock.rs cli json output, dx bundle fix, dx serve --platform android, race condition, drop ssg platform (#3186) 2024-11-12 09:01:01 -05:00
control_focus.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
counters.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
crm.rs Deprecate relative asset paths, better warnings for asset!() (#3214) 2024-11-13 19:52:23 -05:00
custom_assets.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
custom_html.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
custom_menu.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
disabled.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
dog_app.rs cli json output, dx bundle fix, dx serve --platform android, race condition, drop ssg platform (#3186) 2024-11-12 09:01:01 -05:00
dynamic_asset.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
errors.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
eval.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
file_upload.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
flat_router.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
form.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
future.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
generic_component.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
global.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
hash_fragment_state.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
hello_world.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
hydration.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
image_generator_openai.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
link.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
login_form.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
memo_chain.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
meta.rs Move the history provider into the context (#3048) 2024-10-31 12:44:04 -07:00
multiwindow.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
nested_listeners.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
optional_props.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
overlay.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
popup.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
query_segment_search.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
read_size.rs Deprecate relative asset paths, better warnings for asset!() (#3214) 2024-11-13 19:52:23 -05:00
README.md File explorer example moved from examples to example-projects. (#3009) 2024-09-30 07:04:11 -05:00
readme.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
reducer.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
resize.rs Deprecate relative asset paths, better warnings for asset!() (#3214) 2024-11-13 19:52:23 -05:00
router.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
router_resource.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
rsx_usage.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
scroll_to_top.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
shortcut.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
shorthand.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
signals.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
simple_list.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
simple_router.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
suspense.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
svg.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
title.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
todomvc.rs Fix bundling/path errors, sidecar support, iOS/Android simulator support, asset hotreload fixes, serverfn hotrelad, native tailwind support (#2779) 2024-10-25 17:23:45 -07:00
video_stream.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
weather_app.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
web_component.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
window_event.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
window_focus.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
window_zoom.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
xss_safety.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07: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