Crate adabraka_ui

Crate adabraka_ui 

Source
Expand description

§adabraka-ui: Professional UI Component Library for GPUI

A comprehensive, themeable component library inspired by shadcn/ui, designed specifically for building polished desktop applications using GPUI. Provides a complete set of reusable components with consistent styling, smooth animations, and accessibility support.

§Architecture Overview

The library is organized into several key modules:

  • theme: Design tokens and theming system with light/dark variants
  • components: Core interactive elements (buttons, inputs, selects, etc.)
  • display: Presentation components (tables, cards, badges, etc.)
  • navigation: Navigation components (sidebars, menus, tabs, etc.)
  • overlays: Modal dialogs, popovers, tooltips, and command palettes
  • animations: Professional animation presets and easing functions

§Key Features

  • Theme System: Comprehensive design tokens with automatic light/dark mode support
  • Accessibility: Full keyboard navigation, ARIA labels, and screen reader support
  • Performance: Optimized rendering with virtual scrolling for large datasets
  • Animation: Smooth, professional animations using spring physics and easing curves
  • Type Safety: Strong typing throughout with compile-time guarantees

§Design Philosophy

Components follow shadcn/ui principles with GPUI-specific optimizations:

  • Composition over inheritance for flexible component APIs
  • Builder pattern for ergonomic component construction
  • Entity-based state management for complex interactive components
  • Consistent naming and styling patterns across all components

§Usage Example

use adabraka_ui::{prelude::*, theme};

// Initialize theme and components
fn init_app(cx: &mut gpui::App) {
    theme::install_theme(cx, theme::Theme::dark());
    adabraka_ui::init(cx);
}

// Use components in your views
fn render(cx: &mut gpui::App) -> impl gpui::IntoElement {
    div()
        .child(Button::new("Click me").on_click(|_, _, _| println!("Clicked!")))
        .child(Input::new(&input_state).placeholder("Enter text..."))
}

Re-exports§

pub use icon_config::set_icon_base_path;

Modules§

animations
Animation Utilities and Presets
components
UI components module.
display
Display components module.
fonts
Font loading and registration
icon_config
Icon configuration for custom asset paths Icon configuration for customizing icon asset paths.
layout
Layout components - High-level layout abstractions for common UI patterns.
navigation
Navigation components module.
overlays
Overlay components module.
prelude
Convenient re-exports for end users
theme
Theme System Module
transitions
Transition Components for Smooth UI Animations
util
Extension traits for common types
virtual_list

Functions§

init
Initialize the UI library