# Gum: a UI layout tool that keeps game and app interfaces in XML

> Gum is a C# layout and UI tool that stores interfaces as XML, then renders them through a platform backend, with MonoGame, KNI, raylib, Maui, Silk.NET, Stride, Unity and FNA listed as targets and a built-in theme system that restyles every control from a single line of code. It suits game and tool developers who want designers to move controls around without a recompile, and the cost is that you are adopting a layout model and a theme pipeline that your own rendering code has to fit into.

**vchelaru/Gum** — Flexible layout tool for creating UI on any platform

- Repository: https://github.com/vchelaru/Gum
- Website: https://docs.flatredball.com/gum
- Stars: 645 · Forks: 84
- Language: C#
- License: MIT
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/vchelaru-gum

## Object-oriented layout with inheritance and states

Gum is described as a general purpose UI layout tool built on object-oriented principles, and the project description calls it a flexible layout tool for creating UI on any platform.

The feature list gives the substance. It supports inheritance, object instances, default and overriding variables, states, categorised and uncategorised, and an incredibly flexible layout engine. Those five items together are the design.

Inheritance means a layout element can derive from another, so a button template becomes a primary button template. Object instances mean one definition can be placed many times, with per-instance values. Default and overriding variables are the parameter mechanism, so a colour or a size has a default at the definition and can be overridden at the point of use. And states mean a control can have named appearances, with the categorised and uncategorised distinction allowing a set of related states to be switched as a group.

The state model is the part that separates Gum from a scene graph. In most UI toolkits a state is a boolean set of properties. Here a state is a first-class thing with a name and a categorisation, which is what lets a screen have a set of states like Playing, Paused and GameOver that are switched together rather than as a pile of independent flags.

Gum exports to human-readable JSON, and can be extended either using MEF or by modifying the source code directly. The MEF route is the composition-based one, where extension points are declared and other assemblies contribute implementations, and the alternative is simply forking the source.

The project is MIT licensed, written in C#, with the last push on 2026-10-20 and the listed releases being pre-releases, PreRelease October 13, October 10 and October 9 of 2026.

## One line of code restyles every control

The theming story is the most immediately striking part of the project, and it is a single line of code.

Gum Forms controls look clean by default, and a single line of code restyles every control with a built-in theme, the same UI with a completely different look. You pick one of the shipped themes or author your own:

```csharp
DarkProTheme.Apply(GraphicsDevice);
```

That call takes a graphics device, which tells you two things. First, the theme system is not a set of CSS-like overrides applied at layout time, it is a draw-time operation, so the same theme can produce pixel output through completely different renderers. Second, it applies to every control rather than to selected ones, which is the difference between a theme and a set of styles.

The shipped themes listed in the README are DarkPro, Bubblegum, Neon, Retro 95, Forest Glade and Editor, each with a screenshot. The variety is instructive: a dark professional theme, something playful, a neon look, a period-accurate 1995 style, a nature palette and a workbench look. The point is that they cover the whole UI rather than recolouring a few elements, and that the same layout renders acceptably in all of them.

The theme gallery and usage documentation is on the FlatRedBall docs site, and the main documentation for Gum is at docs.flatredball.com/gum, with the official website being the same domain.

There is a `Themes/` directory at the repository root, so the themes are source in the repository rather than a binary blob in a package, and the samples directory includes several theme galleries, including folders for the game UI samples and for the raylib and Silk.NET runtimes. That is the sensible way to evaluate a theming system, by running the same UI under several themes and seeing what breaks.

## Backends for games, mobile, desktop and Unity

The platform table is the most concrete part of the README, and it shows the project's centre of gravity.

The runtimes are published to NuGet, you install the package for your platform, and all packages share the same version number so they stay in sync. The listed targets are MonoGame, KNI, raylib, Maui, Silk.NET, Stride, Unity as experimental, and FNA.

MonoGame and KNI are the game framework targets, and they are the two that carry a separate Shapes package, `Gum.Shapes.MonoGame` and `Gum.Shapes.KNI`. The note below the table explains why: Shapes is the recommended way to draw rectangles, circles and other primitives in Gum, and on MonoGame and KNI it ships as a separate add-on package installed alongside the runtime, while on the other platforms it is built into the runtime. The raylib, Maui, Silk.NET and Stride rows show Built-in for Shapes, and the FNA row shows that it is not supported.

The interesting row is the last one. Sokol is no longer published. The `Gum.sokol` versions up to 2026.9.2.1 remain on NuGet and still work, but receive no further updates, because the backend depends on Sokol.NET, which is not actively maintained and whose submodule tree broke `git pull` for the Gum repository. The source still lives at `Runtimes/SokolGum/` and builds against a hand-cloned Sokol.NET.

That is a specific kind of failure worth understanding, because it is not a deprecation. The dependency broke the repository's own update workflow, so the backend was frozen rather than deliberately retired, and the fix was to hand-clone the dependency instead of relying on the submodule. A team with a Sokol-based project is now maintaining a fork of the integration themselves.

Unity is marked experimental and is installed through the Unity Package Manager by git URL rather than NuGet, and it needs SkiaGameRendering on top.

Below the platform table sit the two core libraries. `FlatRedBall.GumCommon` provides layout, `GraphicalUiElement` and the Forms logic with no rendering or input of its own, and it is the library to use to build Gum into your own runtime or renderer. `Gum.SkiaSharp` is the Skia renderer that Maui, Silk.NET, Stride and Unity build on. So the layering is clean: GumCommon is the engine, and the platform packages are the backends.

## GumCommon as the portable core, and XML as the interchange

The most useful thing in the platform section is a sentence about the boundary. Gum produces general-purpose XML, so it can be used in virtually any C# environment, and beyond the packages listed above, integrations also exist for environments such as FlatRedBall, Meadow, WPF and Avalonia.

General-purpose XML is the reason the tool survives a change of renderer. A layout stored as XML does not carry any MonoGame, Skia or Silk.NET specifics, so the same file can be loaded by a game and by a desktop tool, and a project that starts on MonoGame and moves to Silk.NET does not have to rewrite its UI.

The cost of that portability is that XML has no type system, so the layout's structure has to be validated at runtime rather than at compile time. The library answers this with the `GraphicalUiElement` type in GumCommon, which is the base of the object-oriented model, and with the typed properties in the layout definitions. The inheritance, instance and variable features all sit on top of that, which is why the tool is described as built on object-oriented principles rather than as a document format.

The repository structure follows the same separation, and it is a large one. `GumCommon/`, `GumCore/` and `GumCoreShared.projitems` hold the shared core, with a shared project file for code reused across the solution. `GumRuntime/`, `GumRuntimeNet6/`, `RenderingLibrary/` and `InputLibrary/` are the runtime, renderer and input pieces. `Runtimes/` holds the per-backend code including the frozen Sokol one, `Themes/` the themes, `Tool/` and `Tools/` the editor tooling, and `DataUi.Core/` and `AvaloniaDataUi/` the data-binding and Avalonia pieces.

There are several solutions in the tree, which tells you the project is built in pieces. `Gum.slnx`, the new solution format, alongside `AllLibraries.sln`, `GumFull.sln`, `Gum.Wpf.sln` and `SkiaGum.sln`. And there is an `AssemblyNameCollisionGuard.targets` file, which is the sort of thing you only need when several runtimes load into the same process and you have had problems with duplicate assembly names.

The samples directory is unusually broad, with folders for FNA, fonts, the game UI samples, Forms, loading Gum from a zip file, the KNI variants, MVVM, MonoGame code generation, immediate mode, themes, MultiGum service, raylib, Silk.NET, WPF and Sokol. That sample list is a good map of what the tool can actually do, since each folder is a small working program rather than a fragment.

## Conclusion

Adopt Gum if you want interface layouts editable outside code, for example by a designer, and if you are on one of the listed backends such as MonoGame, raylib or Silk.NET. Do not adopt it if you need a widget toolkit with accessibility support or a mature form control set, because Gum is a layout and theming tool rather than a form library, and check first that the backend you need is still published, since the Sokol backend is no longer updated and FNA has no Shapes support.

## FAQ

### What is the Gum UI tool?

It is a general purpose UI layout tool built on object-oriented principles, with a flexible layout engine. It supports inheritance, object instances, default and overriding variables, states that can be categorised, and it exports to human-readable JSON and can be extended through MEF or by editing the source.

### How do I install Gum?

Gum's runtimes are published to NuGet, so you install the package for your platform, and all packages share the same version number so they stay in sync. The listed platforms are MonoGame, KNI, raylib, Maui, Silk.NET, Stride, Unity as experimental, and FNA.

### How do I change the look of every Gum control?

A single line of code applies a built-in theme to every control, for example `DarkProTheme.Apply(GraphicsDevice)`, and you can pick one of the shipped themes such as DarkPro, Bubblegum, Neon, Retro 95, Forest Glade or Editor, or author your own.

### What is the difference between GumCommon and the platform runtimes?

FlatRedBall.GumCommon holds the layout, the GraphicalUiElement type and the Forms logic with no rendering or input of its own, and is what you use to build Gum into your own runtime. Gum.SkiaSharp is the Skia renderer that Maui, Silk.NET, Stride and Unity build on.

### Is the Gum Sokol backend still supported?

No. Sokol is no longer published. The Gum.sokol versions up to 2026.9.2.1 remain on NuGet and still work but receive no further updates, because the backend depends on Sokol.NET, which is not actively maintained and whose submodule tree broke git pull for the Gum repository.

### Is Gum still being maintained?

The repository is not archived and the last push was on 2026-10-20, with the listed releases being PreRelease builds dated October 13, October 10 and October 9 of 2026. The project is MIT licensed and documented at docs.flatredball.com/gum.

## Sources

- [License: MIT](https://github.com/vchelaru/Gum/blob/main/LICENSE)
- [Project website](https://docs.flatredball.com/gum)
- [README](https://github.com/vchelaru/Gum/blob/main/README.md)
- [Releases](https://github.com/vchelaru/Gum/releases)
- [vchelaru/Gum on GitHub](https://github.com/vchelaru/Gum)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/vchelaru-gum
