Introduction
Gum is a UI toolkit for C# game developers. This page is a tour of what it can do, with each feature linking to its full documentation. To download the Gum UI tool and start building your UI, see the Setup page.
Design Visually or Write Code
Build your UI in the visual editor, in C# only, or a mix of both.

// Initialize
var panel = new StackPanel();
panel.Spacing = 8;
panel.Visual.X = 16;
panel.Visual.Y = 90;
panel.AddToRoot();
var button = new Button();
button.Text = "Click Me";
button.Width = 200;
panel.AddChild(button);
var textBox = new TextBox();
textBox.Placeholder = "Enter text here...";
textBox.Width = 200;
panel.AddChild(textBox);
var checkBox = new CheckBox();
checkBox.Text = "Check me";
panel.AddChild(checkBox);
var listBox = new ListBox();
listBox.Visual.Width = 200;
listBox.Visual.Height = 120;
for (int i = 0; i < 10; i++)
listBox.Items.Add($"Item {i}");
panel.AddChild(listBox);Runs Everywhere
Run the same UI in MonoGame, raylib, BRUTAL, Unity, and more, on desktop, mobile, and web, with an editor for Windows, macOS, and Linux.

Full UI Controls, Themed
Use ready-made controls such as Button, ListBox, TextBox, and Slider, restyle them with a built-in theme or your own styles, and operate them with a mouse, touch screen, keyboard, or gamepad.

Live Preview and Hot Reload
Open any screen or component in its own window running the real runtime, where buttons click, lists scroll, and text boxes take input, and see your running game update when you save a change in the editor.

Variable References
Point any variable at another variable or a formula, like a spreadsheet, to keep sizes and colors consistent across a project or to generate whole layouts from math, such as an instance's index.

Components with Has-A and Is-A
Build a component once and place customized instances of it inside other components, or extend it with a base type and expose the variables each instance can change.

States and Animations
Save sets of variable values as named states, then switch between them or animate between them on a timeline.

Layouts That Adapt
Position and size objects in pixels, percentages, or relative to their children, then stack, wrap, or arrange them in a grid so the layout fits any resolution.

Gradients, Drop Shadows, and Rounded Rectangles
Draw rectangles and circles with fills, outlines, gradients, drop shadows, and rounded corners.

Shaders and Effects
Render a container to its own texture, then fade, blend, or mask it or apply a shader to everything inside it at once.

Vector or Raster Art
Show sprites and NineSlice panels from image files, or SVG and Lottie vector art through SkiaSharp.

Rich Text and Fonts
Style individual words with BBCode tags, and generate fonts at runtime from a font name and size.

Localization
Link a CSV or RESX file to your project and switch languages in the editor to check how longer text fits your layout.

Full Code Generation
Generate C# classes for your screens and components so your code works with typed properties instead of strings.

Binding and MVVM
Bind controls to a view model so your UI stays in sync with your game data.

Native AOT Ready
Publish with Native AOT or trimming after converting your project to the JSON file format.
Customizable Down to the Renderer
Replace the visuals behind any control, down to adding your own renderable types, when styling is not enough.

Tooling
Create projects, check for errors, and generate code from the command line with GumCli, extend the editor with plugins, and give an AI assistant the Gum documentation.

Time-Tested and Reliable
Gum has been used in commercial projects of all sizes. See them on the Showcase page.
Completely Open Source
The Gum tool and every runtime are open source under the MIT license. Use them in commercial projects, read the code, and contribute on GitHub.
Need Help?
Gum is actively maintained and provides lots of ways to get answers:
Check the rest of the documentation
Join the Discord chat (shared discord with FlatRedBall)
Create an issue on GitHub
Last updated
Was this helpful?

