dioxus/examples
2024-01-16 11:45:02 -06:00
..
assets fix: Update logos and custom assets example (#960) 2023-04-15 08:02:04 -05:00
mobile_demo implement launch builder for the desktop and web platforms 2024-01-16 08:42:16 -06:00
openid_connect_demo Bring back mroe hooks, remove old hooks, cleanup a number of examples 2024-01-15 17:04:39 -08:00
PWA-example remove cx.render 2024-01-13 21:12:21 -08:00
query_segments_demo Fix the router and stub out a number of crates to get compiling 2024-01-13 20:51:37 -08:00
tailwind add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
all_css.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
all_events.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
calculator.rs implement launch builder for the desktop and web platforms 2024-01-16 08:42:16 -06:00
clock.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
compose.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
control_focus.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
counter.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
crm.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
custom_assets.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
custom_html.rs implement launch builder for the desktop and web platforms 2024-01-16 08:42:16 -06:00
disabled.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
dog_app.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
dynamic_asset.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
error_handle.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
eval.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
file_explorer.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
file_upload.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
filedragdrop.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
flat_router.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
form.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
generic_component.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
hello_world.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
hydration.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
inputs.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
link.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
login_form.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
multiwindow.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
nested_listeners.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
optional_props.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
overlay.rs implement launch builder for the desktop and web platforms 2024-01-16 08:42:16 -06:00
pattern_model.rs implement launch builder for the desktop and web platforms 2024-01-16 08:42:16 -06:00
pattern_reducer.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
read_size.rs implement launch builder for the desktop and web platforms 2024-01-16 08:42:16 -06:00
README.md fix some clippy lints 2023-09-27 10:13:45 -05:00
readme.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
router.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
rsx_usage.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
scroll_to_top.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
shortcut.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
shorthand.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
signals.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
simple_desktop.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
simple_list.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
simple_router.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
spread.rs fix spreading attributes 2024-01-16 11:04:37 -06:00
ssr.rs Experiment with call syntax only working for copy types 2024-01-15 21:12:44 -08:00
streams.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
suspense.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
svg.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
svg_basic.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
tasks.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
textarea.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
todomvc.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
video_stream.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
web_component.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
window_event.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
window_focus.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
window_zoom.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06:00
xss_safety.rs add platform specific functions for launching apps for workspaces 2024-01-16 11:45:02 -06: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

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