Icekey f01db7461f Merge branch 'DioxusLabs:master' into select_example 2 rokov pred
..
PWA-example 459d8d69a7 examples: add PWA w/ Dioxus CLI template (#977) 2 rokov pred
assets c113d96bbe fix: Update logos and custom assets example (#960) 2 rokov pred
README.md 2113827ed9 Remove tui_* examples from README 2 rokov pred
all_css.rs b182a6ee75 chore: clean up interpreter and bindings 2 rokov pred
all_events.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
borrowed.rs b182a6ee75 chore: clean up interpreter and bindings 2 rokov pred
button.rs 14a1039808 make clippy happy 2 rokov pred
calculator.rs b6c7d44a27 fix clippy 2 rokov pred
callback.rs b6c7d44a27 fix clippy 2 rokov pred
clock.rs b6c7d44a27 fix clippy 2 rokov pred
compose.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 rokov pred
counter.rs 9571adea30 add counter example 2 rokov pred
crm.rs 4d73ffa361 fix: save listeners, borrowed props, and pull back props 2 rokov pred
custom_assets.rs c113d96bbe fix: Update logos and custom assets example (#960) 2 rokov pred
custom_html.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 rokov pred
disabled.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
dog_app.rs b6c7d44a27 fix clippy 2 rokov pred
drops.rs c6d4398e36 make clippy happy 2 rokov pred
error_handle.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
eval.rs 6dfe84834d fix eval example 2 rokov pred
fermi.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 rokov pred
file_explorer.rs b6c7d44a27 fix clippy 2 rokov pred
file_upload.rs 22cfff647c Merge branch 'master' into implement-file-engine 2 rokov pred
filedragdrop.rs b6c7d44a27 fix clippy 2 rokov pred
flat_router.rs e0390ff608 fix: advance dynamic root 2 rokov pred
form.rs d9546d9504 Renderers are now packages, not features. (#387) 3 rokov pred
framework_benchmark.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
generic_component.rs 425d8c64dd use the generic parameter in the generic component example 2 rokov pred
heavy_compute.rs d9546d9504 Renderers are now packages, not features. (#387) 3 rokov pred
hello_world.rs d9546d9504 Renderers are now packages, not features. (#387) 3 rokov pred
hydration.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
inlineprops.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
inputs.rs ca0e1fb9ab added select element example 2 rokov pred
link.rs d9546d9504 Renderers are now packages, not features. (#387) 3 rokov pred
login_form.rs 0dad91bc08 wip: pass more events 2 rokov pred
multiwindow.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 rokov pred
nested_listeners.rs c8f88b6428 Fix typo (#702) 2 rokov pred
optional_props.rs d9546d9504 Renderers are now packages, not features. (#387) 3 rokov pred
overlay.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 rokov pred
pattern_model.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
pattern_reducer.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
readme.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
router.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
rsx_compile_fail.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
rsx_usage.rs b6c7d44a27 fix clippy 2 rokov pred
shortcut.rs cf2a79c173 create global shortcut handler for dioxus desktop 2 rokov pred
signals.rs 14a1e4145e feat: implement function accessor 2 rokov pred
simple_desktop.rs c4a18bc24d chore: clean up some clippy warnings and add clippy lints to CI 2 rokov pred
simple_list.rs 6c677e64da chore: make for loops not the same 2 rokov pred
ssr.rs b6c7d44a27 fix clippy 2 rokov pred
suspense.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
svg.rs b4af761038 fix rng in svg dice example (#970) 2 rokov pred
svg_basic.rs d160f38bc2 fix: parsing of attributes without trailing commas 2 rokov pred
tailwind.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 rokov pred
tasks.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred
textarea.rs b6c7d44a27 fix clippy 2 rokov pred
todomvc.rs 3aa7349db7 Add more features to todomvc (#928) 2 rokov pred
window_event.rs c8f88b6428 Fix typo (#702) 2 rokov pred
window_focus.rs cd17f515d4 change to hook api 2 rokov pred
window_zoom.rs 972084ee32 chore: clean up zoom example 2 rokov pred
xss_safety.rs 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 rokov pred

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