dioxus/examples
Evan Almloff 519ec9d294
Move the document trait into a separate crate (#3035)
* add a default head method through eval
* remove the old document trait
* implement document for each platform
* pull out document into a dedicated crate to cut down on shared dependencies
---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-10-14 10:33:37 -07:00
..
assets Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-auth Chore: hoist example projects for discoverability (#2959) 2024-09-16 09:11:33 -05:00
fullstack-desktop Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
fullstack-hello-world Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
fullstack-router Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
fullstack-streaming Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
mobile_demo Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
pwa Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
ssg-github-pages Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
ssg-router Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
ssg-simple Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
tailwind Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
all_events.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
backgrounded_futures.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
calculator.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
calculator_mutable.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
clock.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
control_focus.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
counters.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
crm.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
custom_assets.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
custom_html.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
custom_menu.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
disabled.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
dog_app.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
dynamic_asset.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
errors.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
eval.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
file_upload.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
flat_router.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
form.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
future.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
generic_component.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
global.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
hash_fragment_state.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
hello_world.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
hydration.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
image_generator_openai.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
link.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
login_form.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
memo_chain.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
meta.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
multiwindow.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
nested_listeners.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
optional_props.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
overlay.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
popup.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
query_segment_search.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
read_size.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
README.md File explorer example moved from examples to example-projects. (#3009) 2024-09-30 07:04:11 -05:00
readme.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
reducer.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
resize.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
router.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
router_resource.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
rsx_usage.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
scroll_to_top.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
shortcut.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
shorthand.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
signals.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
simple_list.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
simple_router.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
spread.rs Extend head components with global attributes (#2888) 2024-10-01 10:24:22 -05:00
ssr.rs Update more examples, add css for more examples 2024-02-14 13:48:58 -08:00
streams.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
suspense.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
svg.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
title.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
todomvc.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
video_stream.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
weather_app.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
web_component.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
window_event.rs Move the document trait into a separate crate (#3035) 2024-10-14 10:33:37 -07:00
window_focus.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
window_zoom.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
xss_safety.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07: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

optional_props - Optional props

CSS

tailwind - You can use a library for styling

Input Handling

all_events - Basic event handling demo

file upload - Handle uploading files

form - Handle form submission

inputs - Input values

nested_listeners - Nested handlers and bubbling

textarea - Text area input

State Management

Async

login_form - Login endpoint example

suspense - Render placeholders while data is loading

tasks - Continuously run future

SVG

svg

Server-side rendering

ssr - Rendering RSX server-side

hydration - Pre-rendering with hydration

Common Patterns

disabled - Disable buttons conditionally

errors - 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

crm - Toy multi-page customer management app

dog_app - Accesses dog API

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