shadcn-rust-0.0.1 is not a library.
shadcn-rust
A shadcn-style CLI for Rust UI frameworks (Dioxus, Leptos, Yew, Sycamore).
It copies ready-made components from a registry into your app, writes a project component.json
, and optionally prepares a minimal Tailwind setup.
- Works with a local monorepo registry (
apps/www/registry
) or a remote git registry (cached clone). - Themes (Tailwind CSS presets) are resolved the same way (local → git fallback).
Features
init
– interactive project setup (framework, aliases, Tailwind paths).list
– list available components for the selected framework.add
– copy components from the registry into your project.doctor
– environment & configuration checks.- Automatic registry resolution: local → git cache.
- Automatic themes resolution: local → git cache.
Requirements
- Rust 1.75+ (stable recommended).
- Git (if you want to use the remote registry/themes).
Install
From source (this repo)
From crates.io (once published)
How it finds the Registry & Themes
- Local (preferred): walks up from current dir to find:
apps/www/registry/
apps/www/themes/
- Remote Git (fallback): clones and caches:
https://github.com/codegress-com/shadcn-rust
Cached under your OS cache, e.g.:
~/.cache/shadcn-rust/repo/
└─ apps/www/
├─ registry/
└─ themes/
Quick Start
# 1) Initialize (creates components.json; Tailwind optional)
# 2) List available components
# 3) Add components
# 4) Check setup
Non-interactive mode:
Commands
init
- Creates/updates
component.json
. - Prompts for framework and aliases unless provided.
- Generates Tailwind files if enabled.
list
Lists components available for your framework.
add
--force
overwrites existing.--export
addspub mod ...;
tomod.rs
.
doctor
Checks config, registry, and themes.
component.json
example
Local Registry/Themes
If you have:
your-project/
├─ apps/www/
│ ├─ registry/
│ └─ themes/
└─ app/ # your Rust app
The CLI resolves them automatically.
Git Registry/Themes
Without local apps/www/
, the CLI clones:
https://github.com/codegress-com/shadcn-rust
into your OS cache.
Tailwind configuration
When init
sets up Tailwind:
-
src/tailwind.css
is created from:registry/<framework>/assets/tailwind.css
, orthemes/default/tailwind.css
(fallback).
-
tailwind.config.js
is generated if missing:
/** Auto-generated by shadcn-rust */
module.exports = ;
Change baseColor
in component.json
to switch the brand
color.
License
MIT © Codegress / Contributors