Open a native window in a Rust application and receive keyboard and mouse events on any major operating system with one crate.
Build a cross-platform Rust game or graphics app that handles input events without writing platform-specific window code.
Port a Rust graphics project to WebAssembly by using winit's browser backend for window and event handling.
Combine winit with a Rust rendering library like wgpu to display graphics in a native window across desktop and web.
Requires Rust 1.85 or later, Android builds have additional SDK and NDK requirements beyond the standard desktop setup.
winit is a Rust library for creating and managing windows at the operating system level. It handles window creation and event delivery across multiple platforms: Windows, macOS, Linux with Wayland and other compositors, iOS, Android, and WebAssembly. A program using winit can open a window and receive input events such as key presses, mouse movements, scroll actions, and window resize or close requests. The library is intentionally low-level. It handles opening windows and delivering events but does not draw anything to the screen itself. To display graphics, a developer uses a separate rendering library or graphics API that reads the platform-specific window handles winit exposes. The README links to community-maintained pages that track the state of Rust libraries for GUI applications and game development, for those looking for higher-level options that build on this foundation. Adding winit to a Rust project requires one line in the Cargo.toml dependency file. Full API documentation is hosted on docs.rs. A separate FEATURES.md file in the repository lists what the library covers and what is explicitly out of scope. Platform-specific behavior is documented in the winit::platform module of the API docs. The project is maintained by the rust-windowing organization, which holds weekly meetings and publishes notes online. Community discussion takes place in a Matrix chat room. The minimum supported Rust version is 1.85, and the project follows a documented policy for how that minimum changes over time. Android and Redox OS have separate version requirements noted in the README.
← rust-windowing on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.