Introduction
Welcome to the Unofficial GPUI Cheat Book!
This book is a practical, concise reference for building applications with GPUI, the UI framework from the creators of Zed. This cheat book focuses on getting you up to speed by providing common patterns, recipes, and solutions to typical problems you’ll encounter.
What is GPUI?
GPUI is a fast, productive UI framework for Rust that powers the Zed editor. It offers:
- Performance: GPU-accelerated rendering with efficient state management
- Flexibility: Three levels of abstraction from high-level declarative UI to low-level custom elements
- Ergonomics: Tailwind-inspired styling API and reactive state management
What This Book Covers
This book complements the official documentation and gpui.rs examples by providing:
- Practical patterns for common UI tasks
- Real-world examples beyond hello world
- Best practices from the Zed codebase
- Pitfalls to avoid
- Recipes for building complete features
What This Book Doesn’t Cover
This book assumes you’re already familiar with:
- Rust basics
- The examples on gpui.rs
- Basic GPUI concepts (you’ve read the README)
For comprehensive API documentation, see the GPUI repository.
How to Use This Book
- Linear reading: Start with “Getting Started” if you’re new to GPUI
- Reference: Jump to specific topics when you need them
- Cookbook: Copy and adapt recipes for your needs
Contributing
This is an unofficial, community-maintained resource. Contributions, corrections, and suggestions are welcome!
Let’s get started with Setup!