ui-cli 0.1.8

A CLI to add components to your app.
ui-cli-0.1.8 is not a library.

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

use leptos::prelude::*;

mod components;    // <--- make sure to add this line

use components::ui::button::Button;

fn main() {
    leptos::mount::mount_to_body(move || view! { <App/> });
}

#[component]
fn App() -> impl IntoView {

    let (count, set_count) = signal(0);

    view! {
        <div>
            <p>"Count: "{count}</p>
            <Button on:click=move |_| set_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.