Files
dioxus/examples
Evan AlmloffandJonathan Kelley 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
..
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
2024-10-10 16:00:58 -07:00
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