6c323e9fc5
* Move getting started to Guide * Clean up summary and getting started * Shorten intro by moving stuff to individual platform docs * Make intro even shorter, summarize features * Further cleanup; move development-related docs to separate section * Make `guide` a crate. Turn code samples into examples so that we can check if they compile * Rewrite "Describing the UI": * Focus on RSX syntax (interactivity covered in later chapters); make sure samples are tested; concise language * Move some "special attribute" samples to the `examples` directory * Simplify introduction to components * Simplify introduction to component props * Document Prop features; add code samples * Simplify component children docs * Interactivity: better introduction to events * Hooks: better introduction * Remove outdated doc * Introducs use_ref * Simplify User Input chapter * Document event handler props * Meme editor example * Meme editor walkthrough * Add dark mode example * Guide for context; dark mode example * Guide: custom hooks * Guide: conditional rendering * Guide: rendering lists * Guide: rendering lists + keys * Move remaining infor from Reference to guide * Delete reference book |
||
---|---|---|
.. | ||
assets | ||
core_reference | ||
all_css.rs | ||
all_events.rs | ||
borrowed.rs | ||
calculator.rs | ||
crm.rs | ||
custom_assets.rs | ||
custom_element.rs | ||
custom_html.rs | ||
disabled.rs | ||
dog_app.rs | ||
error_handle.rs | ||
eval.rs | ||
fermi.rs | ||
file_explorer.rs | ||
filedragdrop.rs | ||
flat_router.rs | ||
form.rs | ||
framework_benchmark.rs | ||
heavy_compute.rs | ||
hello_world.rs | ||
hydration.rs | ||
inlineprops.rs | ||
inputs.rs | ||
link.rs | ||
login_form.rs | ||
nested_listeners.rs | ||
optional_props.rs | ||
pattern_model.rs | ||
pattern_reducer.rs | ||
README.md | ||
readme.rs | ||
router.rs | ||
rsx_compile_fail.rs | ||
rsx_usage.rs | ||
ssr.rs | ||
suspense.rs | ||
svg.rs | ||
svg_basic.rs | ||
tailwind.rs | ||
tasks.rs | ||
textarea.rs | ||
todomvc.rs | ||
tui_all_events.rs | ||
tui_border.rs | ||
tui_buttons.rs | ||
tui_color_test.rs | ||
tui_colorpicker.rs | ||
tui_components.rs | ||
tui_frame.rs | ||
tui_hover.rs | ||
tui_keys.rs | ||
tui_list.rs | ||
tui_margin.rs | ||
tui_quadrants.rs | ||
tui_readme.rs | ||
tui_task.rs | ||
tui_text.rs | ||
window_event.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_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
Async
login_form - Login endpoint example
suspense - Render placeholders while data is loading
tasks - Continuously run future
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
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