packages/docs/src/routes/(routes)/docs/install/dioxus/+page.md
Install Rust, WebAssembly Target and Dioxus CLI if you haven't already.
Create a new Dioxus project in the current directory
dx new ./
Initialize a new Node project.
And install Tailwind CSS CLI and daisyUI.
:INFO:
If you don't want to use Node.js, try Tailwind CSS and daisyUI standalone files instead.
npm init -y
npm install tailwindcss@latest @tailwindcss/cli@latest daisyui@latest
Create a new css file tailwind.css at root directory
@source "./src/**/*.{rs,html,css}";
@import "tailwindcss";
@plugin "daisyui";
src/main.rsPut a css file and a button to src/main.rs (and remove old code)
use dioxus::prelude::*;
fn main() {
dioxus::launch(App);
}
#[component]
fn App() -> Element {
rsx! {
document::Stylesheet {href: asset!("/assets/main.css")}
button { class: "btn", "Hello daisyUI" }
}
}
Run the Tailwind CLI
npx @tailwindcss/cli -i ./tailwind.css -o ./assets/main.css --watch
In another terminal, run the Dioxus server
dx serve