12 releases
Uses new Rust 2024
0.1.11 | May 26, 2025 |
---|---|
0.1.10 | May 22, 2025 |
0.1.6 | Apr 16, 2025 |
0.1.0 | Mar 8, 2025 |
#180 in HTTP server
632 downloads per month
50KB
916 lines
General purpose
The goal of this project is to provide a CLI tool to add any number of components to your project. It works for Leptos at the moment, but it will be extended to other frameworks in the future.
Installation
cargo install ui-cli
# └─> 💡 If issues, try with `--force`.
Usage
Step 1: Create a cargo project
cargo new my_project
cd my_project
Step 2: Initialisation
ui init
Step 3: Add components
ui add button
# ui add demo_card demo_button
# └──> Works with any number of components
Step 4: Bolier plate code
Create index.html
in project root directory and update src/main.rs
with following code
src/main.rs
mod components;
use leptos::prelude::*;
use components::ui::button::Button;
fn main() {
leptos::mount::mount_to_body(move || view! { <App/> });
}
#[component]
fn App() -> impl IntoView {
let count = RwSignal::new(0);
view! {
<div>
<p>"Count: "{count}</p>
<Button on:click=move |_| count.update(|count| *count += 1)>"Hit Me"</Button>
</div>
}
}
Now run it with trunk or any other tool like $ trunk serve
Contributions 💪
It works but it's very messy and there is a lot of room for improvements.
Any contribution is welcome!
License
This project is licensed under the MIT License. See the LICENSE file for details.
Dependencies
~30–44MB
~715K SLoC