dioxus/examples
Evan Almloff 20d146d9bd
Simplify the launch builder (#2967)
* improve documentation for the fullstack server context

* Add a section about axum integration to the crate root docs

* make serve_dioxus_application accept the cfg builder directly

* remove unused server_fn module

* improve fullstack config docs

* improve documentation for the server function macro

* fix axum router extension link

* Fix doc tests

* Fix launch builder

* Simplify the launch builder

* don't re-export launch in the prelude

* refactor fullstack launch

* Fix fullstack launch builder

* Update static generation with the new builder api

* fix some formatting/overly broad launch replacements

* fix custom menu example

* fix fullstack/static generation examples

* Fix static generation launch

* A few small formatting fixes

* Fix a few doc tests

* implement LaunchConfig for serve configs

* fix fullstack launch with separate web and server launch methods

* fix check with all features

* dont expose inner core module

* clippy and check

* fix readme

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
backgrounded_futures.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
calculator.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
calculator_mutable.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
clock.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
control_focus.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
counters.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
crm.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
errors.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
eval.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
file_upload.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
flat_router.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
link.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
resize.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
router.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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 Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
todomvc.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
video_stream.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
weather_app.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
web_component.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -07:00
window_event.rs Simplify the launch builder (#2967) 2024-10-10 16:00:58 -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