---
title: "UI Toolkit: Custom controls"
url: https://daily.dev/posts/ui-toolkit-custom-controls-kosydpn0v
source_url: https://www.youtube.com/watch?v=9O4H1E_DcA4
type: video:youtube
source: "Unity"
published: 2026-06-16T23:15:29.682Z
updated: 2026-06-16T23:15:47.218Z
tags: ["game-development", "c#", "unity"]
reading_time: 12
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# UI Toolkit: Custom controls

**[Unity](https://daily.dev/sources/unity)** · 12 min read · 0 upvotes · 0 comments

## Summary

A step-by-step walkthrough of building a custom slide toggle control in Unity's UI Toolkit. Covers inheriting from BaseField<bool>, exposing UXML attributes for UI Builder, structuring the control with BEM-named USS classes, handling click events to flip state, overriding SetValueWithoutNotify to keep visuals in sync, and styling with USS transitions for the sliding animation. Also shows how to query and use the custom control at runtime from a C# MonoBehaviour.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=9O4H1E_DcA4>

---

Tags: [#game-development](https://daily.dev/tags/game-development), [#c#](https://daily.dev/tags/c#), [#unity](https://daily.dev/tags/unity)

[View this post on daily.dev](https://daily.dev/posts/ui-toolkit-custom-controls-kosydpn0v)
