Jonathan Kelley 2884d72b08 chore: make clippy happy 3 years ago
..
assets 430cde7068 feat: default asset server 3 years ago
core_reference 213f54c4d8 Convert all logs to trace 3 years ago
README.md 69dd699b99 Remove outdated example; Add note on performance benchmark 3 years ago
all_css.rs 9f60dfa8b0 feat: add all the css 3 years ago
all_events.rs fcbd260f1a chore: clean up example a bit more 3 years ago
borrowed.rs 901bd5b0cd examples: clippy 3 years ago
calculator.rs aaf9d4665f Update interpreter and example 3 years ago
crm.rs 0f87ebb277 docs: even more docs 3 years ago
custom_assets.rs 6e4ed9e351 examples: fixup asset example 3 years ago
custom_element.rs f67b71c5a5 feat: custom element example 3 years ago
custom_html.rs 049976d23a feat: allow customizing the index and head 3 years ago
disabled.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
dog_app.rs ff81f1c819 feat: update release posts 3 years ago
error_handle.rs 3acd643afb docs: more docs and an errorhandling example 3 years ago
eval.rs 5e475fadd9 add a desktop eval example 3 years ago
fermi.rs 07529e491c fix: subscription should apply internally to hook 3 years ago
file_explorer.rs 901bd5b0cd examples: clippy 3 years ago
filedragdrop.rs 35b22923b2 fix: some examples 3 years ago
flat_router.rs fb1a848124 fix: format examples 3 years ago
form.rs ae2e8a8038 Add some radio buttons to the form example 3 years ago
framework_benchmark.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
heavy_compute.rs 28716248c5 fix: ping window after virtualdom is ready 3 years ago
hello_world.rs 43a368c8bd chore: remove unused import in example 3 years ago
hydration.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
inlineprops.rs ff459f7297 docs: an example for inlineprops 3 years ago
inputs.rs 35b22923b2 fix: some examples 3 years ago
link.rs 35b22923b2 fix: some examples 3 years ago
login_form.rs 07bea88fcc fix: login example 3 years ago
nested_listeners.rs 35b22923b2 fix: some examples 3 years ago
optional_props.rs a2825fb13c updated examples with the new optional props 3 years ago
pattern_model.rs 45980f9a1e Update examples to avoid deprecated API 3 years ago
pattern_reducer.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
readme.rs a4ab2d9de0 feat: enable addassign for usestate 3 years ago
router.rs 35b22923b2 fix: some examples 3 years ago
rsx_compile_fail.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
rsx_usage.rs af8cd51258 test: Add test for generic components 3 years ago
ssr.rs 420a30e5d4 feat: overhaul examples and clean things up 3 years ago
suspense.rs 9211e1fc78 feat: use future fully figured out 3 years ago
svg.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
svg_basic.rs 8d453f52bd Example: SVG Basic shapes from https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Basic_Shapes 3 years ago
tailwind.rs 29bda8aa48 docs: use tailwindv3 in examples 3 years ago
tasks.rs 0f87ebb277 docs: even more docs 3 years ago
textarea.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
todomvc.rs 45980f9a1e Update examples to avoid deprecated API 3 years ago
tui_all_events.rs 2884d72b08 chore: make clippy happy 3 years ago
tui_border.rs 1bb8b04d87 Update examples to avoid deprecated fields 3 years ago
tui_buttons.rs cae0c1409d Fix some warnings: avoid deprecated fields 3 years ago
tui_color_test.rs 9d9aa33e25 add builder pattern and update examples 3 years ago
tui_components.rs 50d509688d feat: update examples for tui 3 years ago
tui_frame.rs 50d509688d feat: update examples for tui 3 years ago
tui_hover.rs 1bb8b04d87 Update examples to avoid deprecated fields 3 years ago
tui_keys.rs f3fcec2bdf Merge branch 'master' of https://github.com/DioxusLabs/dioxus into rusty-events 3 years ago
tui_list.rs 50d509688d feat: update examples for tui 3 years ago
tui_margin.rs 50d509688d feat: update examples for tui 3 years ago
tui_quadrants.rs 50d509688d feat: update examples for tui 3 years ago
tui_readme.rs 50d509688d feat: update examples for tui 3 years ago
tui_task.rs 50d509688d feat: update examples for tui 3 years ago
tui_text.rs 1bb8b04d87 Update examples to avoid deprecated fields 3 years ago
window_event.rs 6c3f5195f4 feat: re-unify set_state 3 years ago
window_zoom.rs 3f4897cd1c example: update example 3 years ago
xss_safety.rs 6c3f5195f4 feat: re-unify set_state 3 years ago

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_element - Render webcomponents

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

Terminal UI

tui_border

tui_buttons

tui_color_test

tui_components

tui_frame

tui_hover

tui_keys

tui_list

tui_margin

tui_quadrants

tui_readme

tui_task

tui_text

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