A starter template for Dioxus Desktop apps, with Tailwind & Nix support.
Act as starter project for writing new desktop apps using Dioxus, along with
This repository is still a work-in-progress. Here's the current progress:
nix build
/ nix run
dioxus-signals
from 0.5)Stretch goals:
In the nix develop
shell, run:
just watch
just bundle
nix run github:srid/dioxus-desktop-template
# Or just `nix run` in the project directory
This repository began in large part to understand how to manage application state in Dioxus Desktop apps, and come up with some best demonstrable practices for it.
App
component, use use_shared_state_provider
to initialize the application state.use_shared_state::<T>
, followed by a .read()
on it, to access the current state value.App
component, use use_context_provider(cx, AppState::new());
let state: AppState = *use_context(cx).unwrap();
to access the current state value.Signal
typeSignal
for its field types. Nested tree of Signal
s is the idiom.state.<field>
to render a component based on a field signaldioxus_signals::use_selector
to produce a derived signaluse_future
to invoke these async methods to update the state before the component is renderer (or upon an user event).rust-flake
This project uses rust-flake to keep flake.nix
minimal.
WEBKIT_DISABLE_COMPOSITING_MODE=1 nix run