Expand description
Carbon UI for GPUI: IBM Carbon v11 visuals, shadcn/ui component API, Material Symbols Sharp icons. Kit owns behavior; this crate owns appearance.
Layers (each depends only on those above it):
| Module | Role |
|---|---|
tokens | Generated by u0ui-codegen from the design reference tokens.json: ColorRole, TypeStyle, spacing/size/radius |
theme | Active CarbonTheme, theme::color, LayerLevel, Kit theme bridge |
typography | Bundled IBM Plex, TypeStyled::type_style |
motion | Carbon curves and durations, reduced motion, state-change animation helpers |
clock | Local wall-clock time (new Date()): toast captions, today |
icons | Material Symbols Sharp Icon, CarbonIcon, asset source, Kit icon mapping |
density | Density (compact desktop default / comfortable) |
components | Carbon components (components::button is the reference) |
t3 | The T3 Code pattern library, composed from the components |
u0 | The u0 pattern library (u0 · … cards: foundations, primitives, …) |
patterns | Building blocks of the Carbon pattern examples (Carbon · Patterns cards) |
use gpui_kit::*;
use u0ui::prelude::*;
struct App;
impl Render for App {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
div()
.bg(color(ColorRole::Background))
.child(Button::new("go", "Create project").icon(CarbonIcon::Add))
}
}
fn main() {
gpui_kit::application().with_assets(u0ui::Assets::new()).run(|cx| {
gpui_kit::init(cx);
u0ui::init(cx);
gpui_kit::open_window(WindowOptions::default(), cx, |_, cx| cx.new(|_| App)).unwrap();
});
}Re-exports§
pub use density::Density;pub use icons::Assets;pub use icons::CarbonIcon;pub use icons::Icon;pub use icons::IconSize;pub use theme::LayerLevel;pub use tokens::CarbonTheme;pub use tokens::ColorRole;pub use tokens::TypeStyle;pub use typography::TypeStyled;
Modules§
- clock
- Local wall-clock time: what the reference’s
new Date()reads (the machine’s time zone, not UTC). Shared by components and demos that show “now” or “today”: toast captions (toLocaleTimeString()), Calendar’s today. - components
- Carbon components. One module per component; see
docs/ARCHITECTURE.mdfor the recipe (buttonis the reference implementation). - density
- Desktop density.
- focus
:focus-visibleinput modality, tracked per window the way Chromium does.- icons
- Material Symbols Sharp icons (the design system’s only icon set).
- measure
- Sizes measured while a frame is laid out, for layouts that depend on
their own width (CSS container queries,
auto-filltracks, fits). - motion
- Carbon motion: easing curves, duration tokens, reduced motion and helpers that animate a value when a state changes.
- patterns
- Building blocks of the Carbon pattern examples (
Carbon · Patternscards,src/patterns.cssin the design reference). The pattern compositions themselves live in the gallery; only the reusable parts are here. - prelude
- Everything a component or page usually needs.
- t3
- The T3 Code pattern library (
src/t3/*.jsxandsrc/t3.cssin the design reference), redrawn with Carbon tokens from the u0ui components. - theme
- The active Carbon theme, role lookup, layering and the Kit theme bridge.
- tokens
- Carbon design tokens, generated by
u0ui-codegenfrom the design reference’stokens.json($U0UI_DESIGN_DIR/tokens.json, outside this repository) into the committedgenerated/tokens.rs. - typography
- IBM Plex fonts and Carbon type styles.
- u0
- The u0 pattern library (
u0 · …cards): the desktop pieces u0 (a macOS coding-agent console) needed on top of Carbon UI. Each module mirrors one reference file,src/ghost/<name>.jsx.
Functions§
- init
- Initialize u0ui. Call once after
gpui_kit::init(cx)and before opening a window: registers the IBM Plex fonts, installs the active theme (White unlesstheme::ActiveThemewas set) and projects it into Kit’s theme, and maps Kit’s default icons to Material Symbols Sharp.