htk

Crates.iohtk
lib.rshtk
version
created_at2026-01-25 20:05:39.442441+00
updated_at2026-01-25 20:20:11.697151+00
descriptionWayland, Skia, Yoga GUI SDK written in Rust
homepagehttps://github.com/stevenstarr/sdk
repositoryhttps://github.com/stevenstarr/sdk
max_upload_size
id2069431
size0
(stevenlstarrjr)

documentation

README

HDK – Rust Graphics and GUI Library

A comprehensive, cross-platform graphics rendering and GUI toolkit library for Rust, built with Skia, Yoga, and Wayland.

⚠️ Alpha software HDK is currently in alpha. APIs are unstable, features are incomplete, and breaking changes should be expected between releases. This project is intended for early adopters, experimentation, and contributors.


Overview

HDK is a modern Rust library providing:

  • Graphics2D: High-performance 2D graphics rendering with Skia
  • GUI: Complete widget-based user interface framework
  • Widgets: Rich set of pre-built UI components
  • Core: Application lifecycle and event handling
  • Math: Essential mathematics utilities for graphics operations

Features

Graphics & Rendering

  • Vector graphics and path drawing
  • Text rendering with custom fonts
  • Image handling and manipulation
  • Brush and pen styles
  • Paint operations with blend modes
  • Picture-based rendering

User Interface

  • Complete widget library (buttons, text fields, dialogs, etc.)
  • Event system with mouse and keyboard handling
  • Window management with Wayland support
  • Style system for theming
  • Clipboard support
  • Focus management

Widgets Included

  • Application Window
  • Buttons (Icon, Push)
  • Input (Entry, Text Area)
  • Selection (Checkbox, Radio Button, Combo Box)
  • Containers (Group Box, Scroll View, Splitter)
  • Display (Label, Image View, Icon View)
  • Complex (Table View, Tree View, List View)
  • Navigation (Notebook, Header Bar, Toolbar, Breadcrumbs)
  • Feedback (Toast, Tooltip, Progress Bar, Spinner)
  • Dialogs (Color Picker, File Dialog, Custom Dialogs)
  • And more…

Project Structure

sdk/
├── modules/
│   ├── lib.rs                 # Main library entry point
│   ├── core/                  # Application lifecycle
│   ├── graphics2d/            # 2D graphics rendering
│   ├── gui/                   # GUI framework core
│   ├── math/                  # Mathematics utilities
│   └── widgets/               # UI widget components
├── examples/                  # Example applications
├── assets/                    # Resources (fonts, images)
└── Cargo.toml                 # Project configuration

Getting Started

Installation

Add to your Cargo.toml:

[dependencies]
htk = "0.1.0"

Basic Example

  use htk::prelude::*;
use htk::{ApplicationWindow, Label, VBox};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create the application window
    let mut window = ApplicationWindow::builder()
        .title("Hello HTK")
        .default_width(400)
        .default_height(300)
        .build();

    // Show the window
    window.present();

    // Run the widget loop and build the UI
    window.run_widget_loop(|| {
        let mut root = VBox::new(0);

        let label = Label::builder()
            .label("Hello, World!")
            .build();

        root.append(label);

        Box::new(root)
    })?;

    Ok(())
}

Running Examples

Interactive window demo

cargo run --example interactive_window_demo

By default, this example enables visual layout debugging, displaying layout bounds and guides to assist with UI development and debugging.

Disable visual layout debugging

To run the example without visual layout debugging, use release mode:

cargo run --release --example interactive_window_demo

Release builds disable layout visual debugging and render a clean UI output.


Dependencies

  • skia-safe: Skia graphics library bindings for high-performance 2D rendering
  • yoga: Yoga layout engine for responsive, flexbox-style layouts
  • wayland-client: Wayland protocol support for window management
  • Additional platform-specific dependencies

Building

cargo build --release

Platform Support

  • Linux (primary, Wayland-based)
  • Cross-platform foundations in place for future expansion

Development

The library is organized into modular components:

  • core: Application and event loop management
  • graphics2d: Low-level graphics operations via Skia
  • gui: High-level GUI framework and window management
  • widgets: Pre-built UI components
  • math: Vector math and geometric utilities

Documentation

Build and view the documentation locally:

cargo doc --open

License

Licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Commit count: 0

cargo fmt