176e67e5b7
* switch to a Document trait and introduce Script/Head/Style/Meta components * Fix desktop title * Insert special elements into the head during the inital SSR render * Make all head component attributes optional * hydrate head elements * improve the server streaming head warning * Document fullstack head hydration approach * deduplicate head elements by href * move Link into head::Link * document head components * add meta and title examples * Fix a few doc examples * fix formatting * Add title to playwright tests * serde is optional on web, but it is enabled by hydrate * remove leftover console log |
||
---|---|---|
.. | ||
assets | ||
mobile_demo | ||
openid_connect_demo | ||
PWA-example | ||
tailwind | ||
all_events.rs | ||
backgrounded_futures.rs | ||
calculator.rs | ||
calculator_mutable.rs | ||
clock.rs | ||
control_focus.rs | ||
counters.rs | ||
crm.rs | ||
custom_assets.rs | ||
custom_html.rs | ||
custom_menu.rs | ||
disabled.rs | ||
dog_app.rs | ||
dynamic_asset.rs | ||
errors.rs | ||
eval.rs | ||
file_explorer.rs | ||
file_upload.rs | ||
flat_router.rs | ||
form.rs | ||
future.rs | ||
generic_component.rs | ||
global.rs | ||
hash_fragment_state.rs | ||
hello_world.rs | ||
hydration.rs | ||
image_generator_openai.rs | ||
link.rs | ||
login_form.rs | ||
memo_chain.rs | ||
meta.rs | ||
multiwindow.rs | ||
nested_listeners.rs | ||
optional_props.rs | ||
overlay.rs | ||
popup.rs | ||
query_segment_search.rs | ||
read_size.rs | ||
README.md | ||
readme.rs | ||
reducer.rs | ||
router.rs | ||
router_resource.rs | ||
rsx_usage.rs | ||
scroll_to_top.rs | ||
shortcut.rs | ||
shorthand.rs | ||
signals.rs | ||
simple_list.rs | ||
simple_router.rs | ||
spread.rs | ||
ssr.rs | ||
streams.rs | ||
suspense.rs | ||
svg.rs | ||
title.rs | ||
todomvc.rs | ||
video_stream.rs | ||
weather_app.rs | ||
web_component.rs | ||
window_event.rs | ||
window_focus.rs | ||
window_zoom.rs | ||
xss_safety.rs |
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
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
file_explorer - File browser that uses use_ref
to interact with the model
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