dioxus/examples
2024-01-11 14:55:56 -08:00
..
assets fix: Update logos and custom assets example (#960) 2023-04-15 08:02:04 -05:00
mobile_demo make collect-assets not optional in dioxus fullstack 2024-01-09 13:58:28 -06:00
openid_connect_demo Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
PWA-example fix: Add the --locked param to every cli installation command (#1427) 2023-09-04 07:28:38 -05:00
query_segments_demo Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
tailwind Pin assets sha to keep CI in check 2024-01-08 14:54:02 -08:00
all_css.rs chore: clean up interpreter and bindings 2022-12-05 16:47:04 -08:00
all_events.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
borrowed.rs chore: clean up interpreter and bindings 2022-12-05 16:47:04 -08:00
calculator.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
callback.rs fix clippy 2023-01-27 20:35:46 -06:00
clock.rs Clean up and document the protocol handler 2024-01-04 19:52:49 -08:00
compose.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
control_focus.rs Make clippy happy 2024-01-10 23:26:26 -08:00
counter.rs port examples to new events 2023-09-01 15:38:55 -05:00
crm.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
custom_assets.rs Pin assets sha to keep CI in check 2024-01-08 14:54:02 -08:00
custom_html.rs Less clumsy configuration for desktop and mobile (#553) 2022-09-13 16:22:27 -07:00
disabled.rs chore: rename all &cx to cx, make clipppy happy 2022-12-07 13:11:40 -08:00
dog_app.rs Add system for creating component attributes + new #[component] attribute (#1448) 2023-09-15 09:13:36 -05:00
drops.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
dynamic_asset.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
error_handle.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
eval.rs Feat: add global context functions 2023-10-23 16:26:10 -04:00
fermi.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
file_explorer.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
file_upload.rs fix merge conflicts for files 2024-01-08 14:08:21 -08:00
filedragdrop.rs fix clippy 2023-01-27 20:35:46 -06:00
flat_router.rs Add system for creating component attributes + new #[component] attribute (#1448) 2023-09-15 09:13:36 -05:00
form.rs port examples to new events 2023-09-01 15:38:55 -05:00
framework_benchmark.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
generic_component.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
heavy_compute.rs Renderers are now packages, not features. (#387) 2022-07-09 15:15:20 -04:00
hello_world.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
hydration.rs fix all broken examples (#1248) 2023-07-25 14:30:08 -05:00
inlineprops.rs Add system for creating component attributes + new #[component] attribute (#1448) 2023-09-15 09:13:36 -05:00
inputs.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
link.rs Add system for creating component attributes + new #[component] attribute (#1448) 2023-09-15 09:13:36 -05:00
login_form.rs Merge branch 'master' into events-2 2024-01-04 19:02:00 -06:00
multiwindow.rs Feat: add global context functions 2023-10-23 16:26:10 -04:00
nested_listeners.rs Fix typo (#702) 2023-01-01 14:41:18 -06:00
optional_props.rs show more cases in the optional props example 2023-11-29 11:39:38 -06:00
overlay.rs Feat: add global context functions 2023-10-23 16:26:10 -04:00
pattern_model.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
pattern_reducer.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
read_size.rs fix link component 2023-07-26 10:18:39 -07:00
README.md fix some clippy lints 2023-09-27 10:13:45 -05:00
readme.rs fix: window zoom 2022-12-30 02:09:02 -05:00
router.rs Add system for creating component attributes + new #[component] attribute (#1448) 2023-09-15 09:13:36 -05:00
rsx_compile_fail.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
rsx_usage.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
scroll_to_top.rs Make clippy happy 2024-01-10 23:26:26 -08:00
shared_state.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
shortcut.rs Fix merge errors 2023-06-30 12:48:25 -07:00
shorthand.rs Components participate in event handlers 2024-01-11 12:11:27 -08:00
signals.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
simple_desktop.rs Add system for creating component attributes + new #[component] attribute (#1448) 2023-09-15 09:13:36 -05:00
simple_list.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
simple_router.rs Add system for creating component attributes + new #[component] attribute (#1448) 2023-09-15 09:13:36 -05:00
spread.rs fix merge 2024-01-06 08:58:49 -06:00
ssr.rs fix clippy 2023-01-27 20:35:46 -06:00
streams.rs Add example of working with streams 2024-01-08 11:25:20 -08:00
suspense.rs fix all broken examples (#1248) 2023-07-25 14:30:08 -05:00
svg.rs Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
svg_basic.rs fix: parsing of attributes without trailing commas 2022-12-12 11:18:36 -08:00
tasks.rs chore: rename all &cx to cx, make clipppy happy 2022-12-07 13:11:40 -08:00
textarea.rs port examples to new events 2023-09-01 15:38:55 -05:00
todomvc.rs dont use magnanis for todomv 2024-01-11 14:55:56 -08:00
video_stream.rs Make clippy happy 2024-01-05 23:16:30 -08:00
web_component.rs fix formatting 2023-03-19 20:47:16 -05:00
window_event.rs Fix typo (#702) 2023-01-01 14:41:18 -06:00
window_focus.rs Make clippy happy 2024-01-05 12:54:39 -08:00
window_zoom.rs Merge branch 'master' into events-2 2024-01-04 19:02:00 -06:00
xss_safety.rs port examples to new events 2023-09-01 15:38:55 -05: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