drift

module
v0.23.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: MIT

README

Drift logo

Drift

Drift is a cross-platform mobile UI framework. Write your app once in Go, then build native Android and iOS apps via the Drift CLI.

Why Drift?

  • Single codebase - Write once, deploy to Android and iOS
  • Go-native - Use Go's tooling, testing, and ecosystem
  • Skia rendering - Hardware-accelerated graphics (same engine as Chrome and Flutter)
  • No bridge overhead - Direct native compilation, no VM layer
  • iOS builds on Linux - Build iOS apps without a Mac using xtool

Quick Start

# Install the CLI
go install github.com/go-drift/drift/cmd/drift@latest

# Create and run a new project
drift init hello-drift
cd hello-drift
drift run android

Skia binaries are downloaded automatically on first run.

Documentation

Full documentation is available at driftframework.dev:

Showcase

The showcase/ directory contains a demo app with examples of all widgets:

https://github.com/user-attachments/assets/41dcef40-21d1-44bd-adff-56f637ff91e0

cd showcase
drift run android

Repo Layout

Directory Description
cmd/drift CLI commands
pkg/ Runtime, widgets, and rendering
showcase/ Demo application
scripts/ Skia build helpers
third_party/skia Skia source checkout
third_party/drift_skia Skia bridge outputs
SKIA_REV Pinned Skia commit hash

API Stability

Drift follows semantic versioning.

Before v1.0.0: Breaking changes may occur in any release.

After v1.0.0:

  • Deprecated APIs are marked with // Deprecated: use X instead
  • Deprecated APIs remain for at least 2 minor versions
  • Breaking changes only in major versions

Roadmap

v1.0.0 targets:

  • Testing framework with widget tests and golden tests
  • More widgets (Dialog, BottomSheet, Drawer, Snackbar, Slider)
  • Internationalization (i18n/l10n)
  • Developer tools (widget inspector, performance profiling)
  • Hot reload

Contributing

Contributions are welcome!

License

MIT License. See LICENSE for details.

Directories

Path Synopsis
cmd
docgen command
Package main provides a documentation generator for Drift.
Package main provides a documentation generator for Drift.
drift command
Package main is the entry point for the Drift CLI tool.
Package main is the entry point for the Drift CLI tool.
drift/cmd
Package cmd implements the Drift CLI commands.
Package cmd implements the Drift CLI commands.
drift/internal/cache
Package cache provides centralized cache directory resolution for Drift.
Package cache provides centralized cache directory resolution for Drift.
drift/internal/errors
Package errors provides error formatting and display for the Drift CLI.
Package errors provides error formatting and display for the Drift CLI.
drift/internal/fetch
Package fetch provides HTTP download utilities and GitHub API interactions for fetching prebuilt Skia binaries.
Package fetch provides HTTP download utilities and GitHub API interactions for fetching prebuilt Skia binaries.
drift/internal/icongen
Package icongen generates app icons for Android and iOS from a single source image.
Package icongen generates app icons for Android and iOS from a single source image.
drift/internal/templates
Package templates provides embedded template files for project creation.
Package templates provides embedded template files for project creation.
drift/internal/xtool
Package xtool provides SDK detection and configuration for building iOS apps using xtool.
Package xtool provides SDK detection and configuration for building iOS apps using xtool.
pkg
animation
Package animation provides animation primitives for building smooth, physics-based animations in Drift applications.
Package animation provides animation primitives for building smooth, physics-based animations in Drift applications.
core
Package core provides the widget and element framework interfaces and lifecycle.
Package core provides the widget and element framework interfaces and lifecycle.
drift
Package drift provides the main entry point for Drift applications.
Package drift provides the main entry point for Drift applications.
engine
Package engine provides the core rendering engine for the Drift framework.
Package engine provides the core rendering engine for the Drift framework.
errors
Package errors provides structured error handling for the Drift framework.
Package errors provides structured error handling for the Drift framework.
focus
Package focus provides focus management structures.
Package focus provides focus management structures.
gestures
Package gestures provides gesture recognition for pointer input, including an arena for resolving competing recognizers and common gesture types like tap and pan.
Package gestures provides gesture recognition for pointer input, including an arena for resolving competing recognizers and common gesture types like tap and pan.
graphics
Package graphics provides low-level graphics primitives for drawing.
Package graphics provides low-level graphics primitives for drawing.
layout
Package layout provides layout value types and the render system.
Package layout provides layout value types and the render system.
lottie
Package lottie provides Lottie animation loading and rendering using Skia's Skottie module.
Package lottie provides Lottie animation loading and rendering using Skia's Skottie module.
navigation
Package navigation provides routing and navigation for the Drift framework.
Package navigation provides routing and navigation for the Drift framework.
overlay
Package overlay provides core overlay infrastructure for modals, dialogs, bottom sheets, and other floating UI elements.
Package overlay provides core overlay infrastructure for modals, dialogs, bottom sheets, and other floating UI elements.
platform
Package platform provides global singletons for platform services.
Package platform provides global singletons for platform services.
semantics
Package semantics provides accessibility semantics support for Drift.
Package semantics provides accessibility semantics support for Drift.
skia
Package skia provides a stub implementation for non-supported platforms.
Package skia provides a stub implementation for non-supported platforms.
svg
Package svg provides SVG loading and rendering using Skia's native SVG DOM.
Package svg provides SVG loading and rendering using Skia's native SVG DOM.
testing
Package testing provides a widget testing framework for Drift.
Package testing provides a widget testing framework for Drift.
testing/internal/testbed
Package testbed provides internal test widgets for the testing framework.
Package testbed provides internal test widgets for the testing framework.
theme
Package theme provides theming support for the Drift framework.
Package theme provides theming support for the Drift framework.
validation
Package validation provides accessibility validation and linting tools.
Package validation provides accessibility validation and linting tools.
widgets
Package widgets provides UI components for building widget trees.
Package widgets provides UI components for building widget trees.
showcase module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL