Jonathan Kelley 5253ce6b65 wip: usecallback 2 роки тому
..
assets 430cde7068 feat: default asset server 3 роки тому
README.md f89cd20455 fix tui example links (#607) 2 роки тому
all_css.rs 8caabb97d8 wip: more work on html 2 роки тому
all_events.rs 0dad91bc08 wip: pass more events 2 роки тому
borrowed.rs d734dc5b46 Remove argument from `use_hook` closure (#496) 3 роки тому
calculator.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
callback.rs 5253ce6b65 wip: usecallback 2 роки тому
crm.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
custom_assets.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
custom_element.rs 04bc635ac5 wip: prep to fix bug in create 2 роки тому
custom_html.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
disabled.rs 41b450eedf chore: remove unnecessary brackets from examples (#552) 2 роки тому
dog_app.rs 5253ce6b65 wip: usecallback 2 роки тому
error_handle.rs 66319cf6e2 wip: queue mods 2 роки тому
eval.rs e09b6bf813 chore: tweak generic arguments and iterators in rsx 2 роки тому
fermi.rs 04bc635ac5 wip: prep to fix bug in create 2 роки тому
file_explorer.rs ea7ab5f765 wip: it works more 2 роки тому
filedragdrop.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
flat_router.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
form.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
framework_benchmark.rs e09b6bf813 chore: tweak generic arguments and iterators in rsx 2 роки тому
generic_component.rs 30ef225812 feat: event handling on desktop 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 0dad91bc08 wip: pass more events 2 роки тому
inlineprops.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
inputs.rs 30ef225812 feat: event handling on desktop 2 роки тому
link.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
login_form.rs 0dad91bc08 wip: pass more events 2 роки тому
nested_listeners.rs 41b450eedf chore: remove unnecessary brackets from examples (#552) 2 роки тому
optional_props.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
pattern_model.rs 0dad91bc08 wip: pass more events 2 роки тому
pattern_reducer.rs 41b450eedf chore: remove unnecessary brackets from examples (#552) 2 роки тому
readme.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
router.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
rsx_compile_fail.rs 04bc635ac5 wip: prep to fix bug in create 2 роки тому
rsx_usage.rs e09b6bf813 chore: tweak generic arguments and iterators in rsx 2 роки тому
simple_list.rs 6c677e64da chore: make for loops not the same 2 роки тому
ssr.rs 04bc635ac5 wip: prep to fix bug in create 2 роки тому
suspense.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
suspense2.rs 642b21f125 suspense works in desktop 2 роки тому
svg.rs ea7ab5f765 wip: it works more 2 роки тому
svg_basic.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
tailwind.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
tasks.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
textarea.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
todomvc.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
window_event.rs 540e785d8b Less clumsy configuration for desktop and mobile (#553) 2 роки тому
window_zoom.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому
xss_safety.rs d9546d9504 Renderers are now packages, not features. (#387) 3 роки тому

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_all_events - All of the terminal events

tui_border - Different styles of borders and corners

tui_buttons - A grid of buttons that work demonstrate the focus system

tui_color_test - Grid of colors to demonstrate compatablility with different terminal color rendering modes

tui_colorpicker - A colorpicker

tui_components - Simple component example

tui_flex - Flexbox support

tui_hover - Detect hover and mouse events

tui_list - Renders a list of items

tui_margin - Margins around flexboxes

tui_quadrants - Four quadrants

tui_readme - The readme example

tui_task - Background tasks

tui_text - Simple text 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