Generally, you can apply the 9-slice technique to a regular 2D Sprite. However, with UI Toolkit, you can apply the 9-slice technique to Texture, Render Texture, and SVG Vector images.
To apply the 9-slice technique to an image:
To apply the 9-slice technique to a selected image with USS:
You can also specify the slice values directly in USS, UXML, or C# files for the following properties:
-unity-slice-left
-unity-slice-right
-unity-slice-top
-unity-slice-bottom
-unity-slice-scale
Important: