UI Builder Friction: Working with ListView with no item preview

When creating UI Documents that contain ListViews, it’s often quite hard to get a feel for the final look because the items are not displayed.

In my previous projects (using UGUI), this was a big point of friction with our artists so we added the concept of “ghosts” during the prefab editing process. They are temporary items spawned only for preview. Nothing is saved. Clicking on a ghost selects the container that spawned them.

When editing UI Documents, we are faced with the same kind of friction, but there is no apparent solution.


What do you think about this issue? Would “preview items” (like ghosts) be a feature that could be added to UI Toolkit? Is there already a good workaround I’m not aware of? Is it something we should implement ourselves?

When coding your own custom visual elements, it’s fairly straight forward to have faux displays for visualising in the builder.

So in the constructor you can do this:

public class SomeVisualElement : VisualElement
{
    public SomeVisualElement() : base()
    {
        
        if (Application.isPlaying == false)
        {
            BuildMockUp();
        }
    }
    
    private void BuildMockUp()
    {
        // populate with faux data/visuals
    }
}

Had no issues doing this.

1 Like