Auto Fields

AutoFields automatically generates strongly-typed C# fields for your UI Toolkit elements based on their name attributes in UXML files. No more manual Q<>() lookups or repetitive boilerplate code — just clean, direct access to your UI components right from your scripts.
 
Zero Boilerplate: Automatically maps UXML name attributes to properties.
Strong Typing: Access your buttons, labels, lists, and custom controls with full IDE autocomplete support.
Instant Integration: Add a UXML file to trackable assets or just track all and let the system do the rest.
Seamless Workflow: Works with both editor and runtime UI — perfect for tools, inspectors, and runtime UIs alike.
Easy to integrate and use with the already existing UI.
 
For those who are tired of writing root.Q<Button>("my-button") for the hundredth time.
 
Works especially well when used alongside the HotReload plugin — newly generated or updated fields become available almost instantly without waiting for a full domain reload.
 
Documentation