Algosyntax Logo

Creating Custom Widgets In Unreal Engine

When working in Unreal Engine, there are many situations where the default UMG (Unreal Motion Graphics) widgets don’t fully meet your project’s needs. In such cases, you may want to extend existing widgets or create entirely new ones from scratch. With Unreal Engine’s powerful C++ API and the Slate UI framework, you can customize your widgets to achieve the desired look and functionality.

Why Custom Widgets?

Custom widgets offer benefits like:

  • Tailored Functionality: Add features specific to your application.
  • Optimized Performance: Eliminate unnecessary features to improve efficiency.
  • Enhanced Appearance: Design visually distinct components that align with your game’s art style.

Using C++ and Slate

To create a custom widget, you will primarily use the Unreal Engine C++ API and Slate. Here’s a quick rundown:

  1. Create a New C++ Class: Start by creating a new C++ class that derives from UUserWidget or a suitable parent class, depending on your specific requirements.

					/ MyCustomWidget.h
#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "MyCustomWidget.generated.h"

class MYPROJECT_API UMyCustomWidget : public UUserWidget

    virtual void NativeConstruct() override;

Define the Widget Structure: In the .cpp file, you can override the NativeConstruct() function to initialize the widget’s contents.

					// MyCustomWidget.cpp
#include "MyCustomWidget.h"

void UMyCustomWidget::NativeConstruct()

    // Example: Set up your widget's internal properties, bindings, etc.
    // This will include configuring child Slate widgets if needed.


Integrate Slate for Custom Layouts: For more advanced customization, define a new Slate widget class and integrate it with your custom widget.

					// MySlateWidget.h
#pragma once

#include "Widgets/SCompoundWidget.h"

class MYPROJECT_API SMySlateWidget : public SCompoundWidget
    SLATE_BEGIN_ARGS(SMySlateWidget) {}

    void Construct(const FArguments& InArgs);

    // Your widget-specific variables and methods here

// MySlateWidget.cpp
#include "MySlateWidget.h"
#include "Widgets/Text/STextBlock.h"

void SMySlateWidget::Construct(const FArguments& InArgs)
        .Text(FText::FromString("Hello, Slate!"))

  1. Extend Functionality: Add custom functionality to your widget by incorporating Blueprint callable functions, dynamic styling options, or data bindings.

  2. Compile and Test: Build your project, then test your widget in the editor or runtime to ensure everything is functioning correctly.


Welcome to our audio and rhythm plugins collection! With MidiEngine, you can easily import MIDI files and use midi events to create engaging rhythm gameplay or enhance your videos.


Plugin that helps add UMG Widgets to Level Sequences for Text Layers, Movie Titles, 2D layers and more… directly within sequencer. Cross platform.


Let your end users Split And Resize The UI at runtime. Perfect for both games and Applications.

Consider investing in some of our plugins. They might save you some time.  Also helps supports these tutorials.

Instantly get access to our plugins like Blender Curves Importer and UMG Cinematics and more when  you support us on Patreon!

 Join Us On Discord For More Daily Tips!