Skip to content

UI Framework

The recommended, and fastest way to start building UI with StardewUI is via the Framework API. This is a standalone mod, which on mod sites is simply named StardewUI.

Using the Framework

If you're new to the framework, please check out the Getting Started guide. It includes everything needed to spawn a menu or HUD using just a few lines of code along with a StarML file.

Summary of the steps in that guide:

  1. Import the API
  2. Register asset paths
  3. Create a view (some examples are provided)
  4. Make sure your view is deployed with your project
  5. Display the menu or HUD

The above steps are intentionally very specific; aside from creating the view, each "step" is usually only 1-2 clicks or lines of code.

Comparison with Content Packs

The "framework" label is an analogy to other UI frameworks such as Angular and WPF, and should not be confused with "Content Pack" frameworks providing add-ons for completely codeless mods. While StarML and Spritesheet JSON are definitely "content" for StardewUI, the crucial element that cannot be fully specified in a content pack is the model – what the UI does, as opposed to how it looks.

A menu or other UI normally exists to provide some function; it's a way to navigate the features of your mod, which are up to you. It would be impractical to try to anticipate every possible reason for a UI to exist, which is an almost infinite space: mod configuration, inventory, shops, NPC interactions, quests, minigames and more. StardewUI requires very little code to use, but it is still a C# framework.

If you're interested in making, contributing to, or helping to define a more limited, content-pack friendly version, possibly based on Game State Queries, Trigger Actions and similar features, please consider either creating your own extension mod or starting/participating in a discussion on GitHub.