8000 GitHub - rust-ui/labs
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rust-ui/labs

Repository files navigation

General Purpose

This repository is designed to be a collaborative working space for creating components for Leptos and Dioxus.

It's only a temporary repository to test and develop components. Once they are ready, they are integrated directly into Rust UI.

Process to follow

👾 Discord

You can join the Discord server to ask questions, discuss the project, and chat about Rust in general — including job opportunities and more.

Setup

Installation

Please refer to Leptos or Dioxus documentation.

You will need these VSCode extensions:

Don't forget to :

  • rustup update

  • cargo install-update -a

  • cargo update

  • git pull origin master --rebase

Run the project

cargo leptos watch

💡 Tips

CSS

If possible, try to use this__pattern for custom CSS classes that you didn't manage to convert to Tailwind. This way, we can distinguish them easily.

Example:

/* For styles you don't know how to convert in Tailwind */
.img__holder {
    clip-path: polygon(37.5% 20%, 62.5% 20%, 62.5% 80%, 37.5% 80%);
    transform: rotate(30deg);
}

JS

At the moment, it's probably better to keep the JS as it is and not use Rust for interacting with the DOM. While using wasm-bindgen or web_sys is possible, it seems overkill for the moment.

The main goal here is to convert the CSS, NOT the JS.

If you still want to modify the JS and only for simple scripts, you can try to use inline JS to avoid having a script.js file to manage.

Example:

<!-- ❌ NO -->
<button id="my__button">Show an alert</button>
<script>
  document.getElementById('my__button').addEventListener('click', () => {
    alert('Hello from JS!');
  });
</script>

<!-- ✅ YES -->
<button onclick="alert('Hello from JS!');">
  "Show an alert"
</button>

PS: This is not mandatory, just a nice to have 😄

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0