# hyuskui
[](https://crates.io/crates/hyuskui)
[](https://ui.hyuskui.com/docs)
[](https://github.com/hyuskui/ui/blob/main/LICENSE)
Beautifully designed components for [GPUI](https://www.gpui.rs), the GPU-accelerated Rust UI framework behind the Zed editor. Copy them into your app with one command and make them your own, the way [shadcn/ui](https://ui.shadcn.com) does for React.
This crate is the CLI. It doesn't add a dependency to your app: `cargo hyuskui add button` copies the component's Rust source into your `src/`, where it's yours to read and change.
- **64 components**: from Button and Dialog to Data Table, Sidebar, Calendar and Chart.
- **One theme**: every color and radius in a single `src/theme.rs`, with light and dark built in.
- **Icons**: the Lucide set and brand marks in `src/icons.rs`, installed with any component that needs them.
- **Works offline**: the whole registry is built into the binary.
Browse every component live, plus [blocks](https://ui.hyuskui.com/blocks/featured) and [charts](https://ui.hyuskui.com/charts/area), at **[ui.hyuskui.com](https://ui.hyuskui.com)**.
## Install
```sh
cargo install hyuskui
```
It installs `cargo-hyuskui`, so you run it as `cargo hyuskui`.
## Quick start
**1. Add GPUI.** The crates.io release of GPUI lags behind, so hyuskui is tested against a pinned Zed commit:
```toml
# Cargo.toml
[dependencies]
gpui = { git = "https://github.com/zed-industries/zed", rev = "a36d4850f3c087bfef8a3552e2e15d72d97efdf4" }
gpui_platform = { git = "https://github.com/zed-industries/zed", rev = "a36d4850f3c087bfef8a3552e2e15d72d97efdf4" }
```
Zed builds with a specific Rust version; pin the same one:
```toml
# rust-toolchain.toml
[toolchain]
channel = "1.100.0"
```
**2. Add components.**
```sh
cargo hyuskui init # src/theme.rs, src/ui/mod.rs, and `mod theme; mod ui;` in main.rs
cargo hyuskui add button card # copies src/ui/button.rs and src/ui/card.rs
```
**3. Use them.**
```rust
mod theme;
mod ui;
use gpui::{div, prelude::*, px, size, App, Bounds, Context, Window, WindowBounds, WindowOptions};
use theme::ActiveTheme;
use ui::button::Button;
struct Hello;
impl Render for Hello {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
div()
.size_full()
.flex()
.items_center()
.justify_center()
.bg(cx.theme().background)
.child(Button::new("hello", "Hello, hyuskui").on_click(|_, _, _| println!("clicked")))
}
}
fn main() {
gpui_platform::application().run(|cx: &mut App| {
theme::init(cx);
let bounds = Bounds::centered(None, size(px(480.0), px(320.0)), cx);
cx.open_window(
WindowOptions { window_bounds: Some(WindowBounds::Windowed(bounds)), ..Default::default() },
|_, cx| cx.new(|_| Hello),
)
.unwrap();
});
}
```
## Commands
| Command | What it does |
|---|---|
| `cargo hyuskui init` | Writes `src/theme.rs`, creates `src/ui/mod.rs`, and declares both modules in `main.rs` or `lib.rs`. |
| `cargo hyuskui add <name...>` | Copies components into `src/ui/` with everything they depend on, and registers them in `mod.rs`. `--all` adds every component; `--overwrite` replaces files you already have. |
| `cargo hyuskui add icons` | Adds `src/icons.rs` on its own. |
| `cargo hyuskui list` | Lists every component. |
| `cargo hyuskui diff <name>` | Shows how your copy differs from the registry, before you overwrite it. |
Run it anywhere inside your project; it finds the nearest `Cargo.toml`. Pass `--path` to point it elsewhere.
## Components
[Accordion](https://ui.hyuskui.com/docs/components/accordion), [Alert](https://ui.hyuskui.com/docs/components/alert), [Alert Dialog](https://ui.hyuskui.com/docs/components/alert-dialog), [Aspect Ratio](https://ui.hyuskui.com/docs/components/aspect-ratio), [Attachment](https://ui.hyuskui.com/docs/components/attachment), [Avatar](https://ui.hyuskui.com/docs/components/avatar), [Badge](https://ui.hyuskui.com/docs/components/badge), [Breadcrumb](https://ui.hyuskui.com/docs/components/breadcrumb), [Bubble](https://ui.hyuskui.com/docs/components/bubble), [Button](https://ui.hyuskui.com/docs/components/button), [Button Group](https://ui.hyuskui.com/docs/components/button-group), [Calendar](https://ui.hyuskui.com/docs/components/calendar), [Card](https://ui.hyuskui.com/docs/components/card), [Carousel](https://ui.hyuskui.com/docs/components/carousel), [Chart](https://ui.hyuskui.com/docs/components/chart), [Checkbox](https://ui.hyuskui.com/docs/components/checkbox), [Code Block](https://ui.hyuskui.com/docs/components/code-block), [Collapsible](https://ui.hyuskui.com/docs/components/collapsible), [Combobox](https://ui.hyuskui.com/docs/components/combobox), [Command](https://ui.hyuskui.com/docs/components/command), [Context Menu](https://ui.hyuskui.com/docs/components/context-menu), [Data Table](https://ui.hyuskui.com/docs/components/data-table), [Date Picker](https://ui.hyuskui.com/docs/components/date-picker), [Dialog](https://ui.hyuskui.com/docs/components/dialog), [Drawer](https://ui.hyuskui.com/docs/components/drawer), [Dropdown Menu](https://ui.hyuskui.com/docs/components/dropdown-menu), [Empty](https://ui.hyuskui.com/docs/components/empty), [Field](https://ui.hyuskui.com/docs/components/field), [Hover Card](https://ui.hyuskui.com/docs/components/hover-card), [Input](https://ui.hyuskui.com/docs/components/input), [Input Group](https://ui.hyuskui.com/docs/components/input-group), [Input OTP](https://ui.hyuskui.com/docs/components/input-otp), [Item](https://ui.hyuskui.com/docs/components/item), [Kbd](https://ui.hyuskui.com/docs/components/kbd), [Label](https://ui.hyuskui.com/docs/components/label), [Marker](https://ui.hyuskui.com/docs/components/marker), [Menubar](https://ui.hyuskui.com/docs/components/menubar), [Message](https://ui.hyuskui.com/docs/components/message), [Message Scroller](https://ui.hyuskui.com/docs/components/message-scroller), [Navigation Menu](https://ui.hyuskui.com/docs/components/navigation-menu), [Pagination](https://ui.hyuskui.com/docs/components/pagination), [Popover](https://ui.hyuskui.com/docs/components/popover), [Progress](https://ui.hyuskui.com/docs/components/progress), [Questionnaire](https://ui.hyuskui.com/docs/components/questionnaire), [Radio Group](https://ui.hyuskui.com/docs/components/radio-group), [Resizable](https://ui.hyuskui.com/docs/components/resizable), [Scroll Area](https://ui.hyuskui.com/docs/components/scroll-area), [Select](https://ui.hyuskui.com/docs/components/select), [Separator](https://ui.hyuskui.com/docs/components/separator), [Sheet](https://ui.hyuskui.com/docs/components/sheet), [Sidebar](https://ui.hyuskui.com/docs/components/sidebar), [Skeleton](https://ui.hyuskui.com/docs/components/skeleton), [Slider](https://ui.hyuskui.com/docs/components/slider), [Spinner](https://ui.hyuskui.com/docs/components/spinner), [Switch](https://ui.hyuskui.com/docs/components/switch), [Table](https://ui.hyuskui.com/docs/components/table), [Tabs](https://ui.hyuskui.com/docs/components/tabs), [Textarea](https://ui.hyuskui.com/docs/components/textarea), [Toast](https://ui.hyuskui.com/docs/components/toast), [Toggle](https://ui.hyuskui.com/docs/components/toggle), [Toggle Group](https://ui.hyuskui.com/docs/components/toggle-group), [Tooltip](https://ui.hyuskui.com/docs/components/tooltip), [Trace](https://ui.hyuskui.com/docs/components/trace), [Typography](https://ui.hyuskui.com/docs/components/typography).
## Platforms
GPUI runs on macOS (Metal), Linux (Vulkan, X11 or Wayland), Windows, and the web through WebAssembly; every preview on [ui.hyuskui.com](https://ui.hyuskui.com) is the real component running in your browser.
## Links
- [Documentation](https://ui.hyuskui.com/docs)
- [Installation](https://ui.hyuskui.com/docs/installation)
- [CLI](https://ui.hyuskui.com/docs/cli)
- [Theming](https://ui.hyuskui.com/docs/theming)
- [Icons](https://ui.hyuskui.com/docs/icons)
- [Source](https://github.com/hyuskui/ui)
## License
MIT