UI

ui-toolkit-modern

Builds professional Unity UIs using UXML/USS. The modern, performant standard for runtime interfaces.

Install

mkdir -p .claude/skills/ui-toolkit-modern && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10025" && unzip -o skill.zip -d .claude/skills/ui-toolkit-modern && rm skill.zip

Installs to .claude/skills/ui-toolkit-modern

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Unity UI Toolkit specialist for professional, scalable, responsive runtime UI with UXML and USS.
96 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Build modular UI components
  • Implement data binding
  • Apply USS styling
  • Create responsive layouts
  • Query UI elements

How it works

It utilizes UXML for structure, USS for styling, and C# for logic to create scalable runtime interfaces.

Inputs & outputs

You give it
UI design requirements
You get back
UXML/USS components

When to use ui-toolkit-modern

  • Creating responsive runtime menus
  • Styling UI with USS
  • Building complex data-driven interfaces

About this skill

UI Toolkit Modern

Overview

Unity UI Toolkit for professional runtime UI. Build scalable, modular, responsive interfaces using UXML (structure), USS (styling), and C# (logic). The modern replacement for UGUI Canvas.

When to Use

  • Use for new projects (Unity 2021+)
  • Use for complex, data-driven UI
  • Use for multi-platform responsive design
  • Use for theming and skinning systems
  • Use for professional-grade UI architecture

UI Toolkit vs UGUI

FeatureUI ToolkitUGUI Canvas
Web-like workflow
No GameObjects
Data BindingManual
Styling (USS)Per-element
PerformanceBetterGood
Nested scrollingComplex

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    UI TOOLKIT STACK                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  UXML (Structure)      USS (Styling)      C# (Logic)       │
│  ┌──────────────┐     ┌──────────────┐   ┌──────────────┐  │
│  │ <ui:UXML>    │     │ .button {    │   │ class View { │  │
│  │   <Button>   │────▶│   width: 200;│   │   Query<>()  │  │
│  │   <Label>    │     │   color: #fff│   │   Bind()     │  │
│  │ </ui:UXML>   │     │ }            │   │ }            │  │
│  └──────────────┘     └──────────────┘   └──────────────┘  │
│         │                    │                  │           │
│         └────────────────────┴──────────────────┘           │
│                              │                              │
│                    [UIDocument Component]                   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Core Concepts

ConceptDescription
VisualElementBase class for all elements
UIDocumentMonoBehaviour hosting the UI
UXMLXML-like markup for structure
USSCSS-like styling
UQueryQuery elements by name/class
Data BindingSerializedObject binding

Flexbox Layout

┌─────────────────────────────────────────┐
│ flex-direction: row                     │
│  ┌─────┐  ┌─────┐  ┌─────┐             │
│  │  1  │  │  2  │  │  3  │             │
│  └─────┘  └─────┘  └─────┘             │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│ flex-direction: column                  │
│  ┌──────────────────────┐               │
│  │         1            │               │
│  ├──────────────────────┤               │
│  │         2            │               │
│  ├──────────────────────┤               │
│  │         3            │               │
│  └──────────────────────┘               │
└─────────────────────────────────────────┘

Best Practices

  • ✅ Use USS classes for reusable styles
  • ✅ Query elements once in constructor
  • ✅ Use data binding for dynamic content
  • ✅ Create reusable components (Custom Controls)
  • ✅ Use % and flex for responsive layouts
  • NEVER hardcode pixel sizes (use flex)
  • NEVER query every frame
  • NEVER mix UGUI and UI Toolkit without reason

Few-Shot Examples

Example 1: Basic View Controller

User: "Create a main menu UI."

Agent:

public class MainMenuView : MonoBehaviour
{
    [SerializeField] private UIDocument _uiDocument;
    
    private Button _playButton;
    private Button _settingsButton;
    
    private void OnEnable()
    {
        var root = _uiDocument.rootVisualElement;
        
        _playButton = root.Q<Button>("play-button");
        _settingsButton = root.Q<Button>("settings-button");
        
        _playButton.clicked += OnPlayClicked;
        _settingsButton.clicked += OnSettingsClicked;
    }
    
    private void OnDisable()
    {
        _playButton.clicked -= OnPlayClicked;
        _settingsButton.clicked -= OnSettingsClicked;
    }
}

Example 2: UXML Template

User: "UXML for a settings panel."

Agent:

<ui:UXML xmlns:ui="UnityEngine.UIElements">
    <ui:VisualElement class="panel settings-panel">
        <ui:Label text="Settings" class="title" />
        
        <ui:VisualElement class="setting-row">
            <ui:Label text="Music Volume" />
            <ui:Slider name="music-slider" low-value="0" high-value="1" />
        </ui:VisualElement>
        
        <ui:VisualElement class="setting-row">
            <ui:Label text="SFX Volume" />
            <ui:Slider name="sfx-slider" low-value="0" high-value="1" />
        </ui:VisualElement>
        
        <ui:Button name="back-button" text="Back" class="btn-secondary" />
    </ui:VisualElement>
</ui:UXML>

Example 3: USS Styling

User: "Style for buttons."

Agent:

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    -unity-font-style: bold;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    scale: 1.05;
}

.btn-primary:active {
    scale: 0.95;
}

TDD Contract

⚠️ Legacy Skill — Refactor Pending Este skill NO tiene tests automatizados aún. El siguiente boilerplate es un punto de partida.

// Escribe estos tests ANTES de implementar:

// Test 1: should [expected behavior] when [condition]
[Test]
public void UiToolkitModern_Should{ExpectedBehavior}_When{Condition}()
{{
    // Arrange
    // TODO: Setup test fixtures
    
    // Act
    // TODO: Execute system under test
    
    // Assert
    Assert.Fail("Not implemented — write test first");
}}

// Test 2: should handle [edge case]
[Test]
public void UiToolkitModern_ShouldHandle{EdgeCase}()
{{
    // Arrange
    // TODO: Setup edge case scenario
    
    // Act
    // TODO: Execute
    
    // Assert
    Assert.Fail("Not implemented");
}}

// Test 3: should throw when [invalid input]
[Test]
public void UiToolkitModern_ShouldThrow_When{InvalidInput}()
{{
    // Arrange
    var invalidInput = default;
    
    // Act & Assert
    Assert.Throws<Exception>(() => {{ /* execute */ }});
}}

Pasos para completar el TDD:

  1. Descomenta los tests above
  2. Implementa la funcionalidad mínima para que compile
  3. Ejecuta los tests — deben fallar (RED)
  4. Implementa la funcionalidad real
  5. Verifica que los tests pasen (GREEN)
  6. Refactorea manteniendo los tests verdes

Nota: Este skill fue marcado como tdd_first: false durante la auditoría v2.0.1. La sección TDD fue agregada automáticamente pero requiere customización manual para reflejar el comportamiento real del skill.

Related Skills

  • @responsive-ui-design - Multi-device layouts
  • @menu-navigation-flow - Screen management
  • @input-system-new - UI navigation input

When not to use it

  • Mixing UGUI and UI Toolkit without reason
  • Querying elements every frame

Prerequisites

Unity >= 6.0

Limitations

  • Never hardcode pixel sizes
  • Never query every frame

How it compares

It provides a web-like workflow without GameObjects, unlike the traditional UGUI Canvas system.

Compared to similar skills

ui-toolkit-modern side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ui-toolkit-modern (this skill)05moNo flagsIntermediate
frontend-design4812moNo flagsAdvanced
screenshot-to-code2042moNo flagsBeginner
textual1439moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

frontend-design

anthropics

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

481544

screenshot-to-code

OneWave-AI

Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.

204389

textual

KyleKing

Expert guidance for building TUI (Text User Interface) applications with the Textual framework. Invoke when user asks about Textual development, TUI apps, widgets, screens, CSS styling, reactive programming, or testing Textual applications.

143346

web-artifacts-builder

anthropics

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

49162

radix-ui-design-system

sickn33

Build accessible design systems with Radix UI primitives. Headless component customization, theming strategies, and compound component patterns for production-grade UI libraries.

33130

svelte-ui-design

XIYO

ALWAYS use this skill for ANY Svelte component styling, design, or UI work. Svelte 5 UI design system using Tailwind CSS 4, Skeleton Labs design tokens/presets/Tailwind Components, and Bits UI headless components. Covers class composition, color systems, interactive components, forms, overlays, and all visual design.

23136

Search skills

Search the agent skills registry