1
0
Steven Pecht bdfb3b6285 Update tailwind examples to work with multi-page apps (#1339) 1 жил өмнө
..
PWA-example 39e89c1fac Bump crate versions, fix any publish errors 1 жил өмнө
assets c113d96bbe fix: Update logos and custom assets example (#960) 2 жил өмнө
mobile_demo 10a3b228f6 Add some logging and debug 2 жил өмнө
tailwind bdfb3b6285 Update tailwind examples to work with multi-page apps (#1339) 1 жил өмнө
README.md 2b47602c27 Update README.md 2 жил өмнө
all_css.rs b182a6ee75 chore: clean up interpreter and bindings 2 жил өмнө
all_events.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
borrowed.rs b182a6ee75 chore: clean up interpreter and bindings 2 жил өмнө
button.rs 14a1039808 make clippy happy 2 жил өмнө
calculator.rs b6c7d44a27 fix clippy 2 жил өмнө
callback.rs b6c7d44a27 fix clippy 2 жил өмнө
clock.rs 14c852010b restore clock example 1 жил өмнө
compose.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 жил өмнө
control_focus.rs 19436e210f Merge branch 'upstream' into query-system 2 жил өмнө
counter.rs 9571adea30 add counter example 2 жил өмнө
crm.rs 5f0dd3af3e it almost lives? 1 жил өмнө
custom_assets.rs c113d96bbe fix: Update logos and custom assets example (#960) 2 жил өмнө
custom_html.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 жил өмнө
disabled.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
dog_app.rs e751f63030 Dont use suspense in dog app, remove from use_future 1 жил өмнө
drops.rs c6d4398e36 make clippy happy 2 жил өмнө
error_handle.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
eval.rs 6210c6fefe Convert use_eval to use send/recv system (#1080) 1 жил өмнө
fermi.rs 535435a4cf Fix the issue of duplicate unique ID for atoms using `newtype`. 2 жил өмнө
file_explorer.rs b6c7d44a27 fix clippy 2 жил өмнө
file_upload.rs e39d8708fa Changed `directory` to `webkitdirectory` in `bool_attrs` definitions. 1 жил өмнө
filedragdrop.rs b6c7d44a27 fix clippy 2 жил өмнө
flat_router.rs 5f0dd3af3e it almost lives? 1 жил өмнө
form.rs d9546d9504 Renderers are now packages, not features. (#387) 3 жил өмнө
framework_benchmark.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
generic_component.rs 425d8c64dd use the generic parameter in the generic component example 2 жил өмнө
heavy_compute.rs d9546d9504 Renderers are now packages, not features. (#387) 3 жил өмнө
hello_world.rs d9546d9504 Renderers are now packages, not features. (#387) 3 жил өмнө
hydration.rs d637ef187c fix all broken examples (#1248) 1 жил өмнө
inlineprops.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
inputs.rs ca0e1fb9ab added select element example 2 жил өмнө
link.rs 5f0dd3af3e it almost lives? 1 жил өмнө
login_form.rs f7017fac2e Fix the login form example 1 жил өмнө
multiwindow.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 жил өмнө
nested_listeners.rs c8f88b6428 Fix typo (#702) 2 жил өмнө
optional_props.rs d9546d9504 Renderers are now packages, not features. (#387) 3 жил өмнө
overlay.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 жил өмнө
pattern_model.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
pattern_reducer.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
read_size.rs e7a9161066 fix link component 1 жил өмнө
readme.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
router.rs cfd62e274e Make deprecated use router (#1260) 1 жил өмнө
rsx_compile_fail.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
rsx_usage.rs b6c7d44a27 fix clippy 2 жил өмнө
scroll_to_top.rs a551c0fcb8 add examples for onmounted 2 жил өмнө
shared_state.rs d583e1c750 Fix clippy 1 жил өмнө
shortcut.rs 6512c153dd Fix merge errors 2 жил өмнө
signals.rs 190c65b15d fix memo and add tests 1 жил өмнө
simple_desktop.rs 5f0dd3af3e it almost lives? 1 жил өмнө
simple_list.rs 6c677e64da chore: make for loops not the same 2 жил өмнө
simple_router.rs 30f8218251 Add simpler router 1 жил өмнө
ssr.rs b6c7d44a27 fix clippy 2 жил өмнө
suspense.rs d637ef187c fix all broken examples (#1248) 1 жил өмнө
svg.rs b4af761038 fix rng in svg dice example (#970) 2 жил өмнө
svg_basic.rs d160f38bc2 fix: parsing of attributes without trailing commas 2 жил өмнө
tasks.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө
textarea.rs b6c7d44a27 fix clippy 2 жил өмнө
todomvc.rs 3aa7349db7 Add more features to todomvc (#928) 2 жил өмнө
web_component.rs 03413a68ab fix formatting 2 жил өмнө
window_event.rs c8f88b6428 Fix typo (#702) 2 жил өмнө
window_focus.rs 44025db5b0 add to example 2 жил өмнө
window_zoom.rs 972084ee32 chore: clean up zoom example 2 жил өмнө
xss_safety.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 жил өмнө

README.md

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
  • Spread props
  • Custom elements
  • Component Children: Pass children into child components
  • Render To string: Render a mounted virtualdom to a string
  • Testing and Debugging