QuickUIDesign
About QuickUIDesign Template
QuickUIDesign is a React-based UI development template designed specifically for Unreal Engine 5 (UE5). It provides a complete toolchain for creating interactive UE5 interfaces using modern frontend technologies, enabling developers to build high-performance game UI with React.
Version History
- v1.0.0 Initial release with core template structure, UE5 connection demo, asset toolchain, and Rspack build configuration.
- v1.1.0 Added media asset packaging support, enabling images, audio, video, and other media assets to be bundled into HTML files.
- v1.2.0 Refactored to routing architecture (route-template), introducing React Router v7 routing system, framer-motion page transition animations, and ScreenAnchor screen positioning component system.
- v1.2.5 Added clickdeck-core module, providing a visual editor engine for editing page styles and content in the browser.
Template Structure
The template source code is located in the src/ directory with the following structure:
Core Architecture
Routing System (React Router v7 + MemoryRouter)
The template uses createMemoryRouter — navigation is entirely managed by in-memory routing.
Entry Point: src/pages/route-template/pages/index.tsx
Key Features:
UEProviderwraps the entire route tree, ensuring all child components have access to the UE5 connection contextcreateMemoryRoutercreates an in-memory router instance, with routes defined by therouter_patharray- Route switching is done via
useNavigate()programmatic navigation or<Link>components
Route Configuration: src/pages/route-template/router/index.tsx
Route hierarchy:
- Root route
/: UsesLayoutas the layout component with optional auto-scaling - Child routes:
/renders HomePage,/showrenders ShowPage - Error boundary: Renders
ErrorPageon routing errors
Page Transition Animation System
The template integrates framer-motion v11 for page transition animations.
AnimatedOutlet: src/components/framer-motion/animated-outlet.tsx
Replaces React Router's <Outlet />, using AnimatePresence to wrap child route elements for enter/exit animations:
- Uses
mode="wait": waits for the current page exit animation to complete before entering the new page - Drives
AnimatePresenceroute change detection viakey={location.pathname}
AnimatedLayout: src/components/framer-motion/animated-layout.tsx
Page content animation wrapper that injects framer-motion variants into child elements:
- Each page root element wraps content with
<AnimatedLayout>for animation capabilities - Accepts custom
animateconfig, defaults todefault_animatepresets
Animation Presets: src/lib/data/animate-data.tsx
The exit animation includes random offsets, giving consecutive page transitions a more varied feel.
ScreenAnchor Positioning Component System
src/components/screen-anchor/index.tsx provides a nine-grid positioning component set for precisely placing elements in UE5 fullscreen UI.
AnchorGrid
Container component that creates a relative-positioned fullscreen container:
ScreenAnchor
Positioning anchor component that fixes child elements to one of nine preset screen positions:
Nine-Grid Position Style Mapping:
Usage example:
Page Components
Root Layout: src/pages/route-template/pages/layout.tsx
The application root layout component responsible for:
- Initializing
autofit.jsauto-scaling (controlled viaFitprop) - Calling
useQuickUIEventListener('UEcallback')to enable UE5 event listening - Using
AnimatedOutletto render child routes with animated transitions - Hosting global components independent of route animations (e.g., UEConnect-Demo)
The layout separates the "animation-driven area" (AnimatedOutlet) from the "non-animation-driven area" (#no-animation-driven), ensuring global floating components are unaffected by page transition animations.
Home Page: src/pages/route-template/pages/home/index.tsx
A complete ScreenAnchor positioning component demo page, showcasing all nine anchor positions.
UE5 Route Navigation Events
Both the Home page and ShowPage listen for route navigation events from UE5:
UE5 can control frontend page switching by sending RouteNavigate events (with a route field), enabling bidirectional navigation.
Show Page: src/pages/route-template/pages/show/index.tsx
Demonstrates two image loading modes:
- Base64 Inline Mode: Converts small images to Base64 strings embedded in the HTML, requiring no additional loading
- Static Resource Mode: References images from the
public/directory via relative paths
This comparison helps developers choose the optimal image loading strategy for their use case.
Error Page: src/pages/route-template/pages/error-page.tsx
Route error boundary component that catches routing exceptions and displays error information along with the current path, providing a link back to the home page.
UEConnect-Demo Component: src/components/Ohters/UEConnect-Demo/index.tsx
A complete reference component demonstrating the core ue-connect API usage:
useInputBlocker: Disables right-click context menu and Tab keyuseUEContext: Retrieves UE5 connection status, device type, mouse state, and last key actionuseQuickUIEventSender: Sends custom events to UE5useQuickUIEventListener: Listens for events from UE5data-nohitattribute: Marks elements as non-penetrable for mouse events, ensuring proper event routing between Web UI and UE5
This component renders inside the #no-animation-driven container by default, acting as a global floating panel during page transitions.
DemoContent Component: src/components/Ohters/DemoContent.tsx
A mouse penetration/non-penetration comparison demo component demonstrating the data-nohit attribute in action:
- Red area with
data-nohit: Mouse events do not penetrate to UE5 - Green area without
data-nohit: Mouse events penetrate to the UE5 layer
Build Configuration
rspack.config.js
The project uses Rspack (a high-performance Rust-based web build tool) as its core bundler.
Entry Configuration:
src/pages/route-template/pages/index.tsx is the single entry point for the current template.
Module Resolution & Aliases:
@alias simplifies source importsue-connectalias ensures the module reference points to the localue-connect/directory
txt File Loading:
Supports importing .txt files as strings (e.g., Base64-encoded image data).
Dev Server:
Static resources in the public/ directory are served directly through the dev server, allowing relative path references to images, audio, and other assets during development.
ue-connect Module
ue-connect is the core UE5 connector module located in the ue-connect/ directory. It provides a complete set of hooks and context management tools for establishing bidirectional communication between React and UE5.
For detailed documentation, please visit the ue-connect documentation
clickdeck-core Module
ClickDeck Core is a browser-based visual editor core module designed specifically for the Vibe Coding workflow. ClickDeck Core allows developers to directly drag, drop, modify styles, and adjust layouts of page DOM elements in the browser, transforming vague "interface feel" into precise "visual annotations."
It is not just a debugging tool, but also the "eyes" and "translator" for AI—all visual editing operations are converted into structured AI Prompt prompts in real time. You only need to "point and click" like a designer, and leave the layout logic and code implementation to AI.
clickdeck-core is a visual editor engine module added in v1.2.5, located in the clickdeck-core/ directory.
assets-tool Utilities
The assets-tool/ directory contains two build helper utilities for optimizing the final output for UE5 integration.
Tool Structure
convertImageToBase64
Supports converting images (PNG/JPG) to Base64-encoded text files, making it easy to embed assets directly in UE5.
Usage:
Corresponding npm script:
How it works:
- Reads the binary data of the image/WASM file
- Converts to a Base64 string with a
data:image/png;base64,ordata:application/wasm;base64,prefix - Generates a
filename-base64.txtfile in the same directory - Supported formats:
.png,.jpg,.jpeg
merge-html
An HTML inlining tool that inlines all external JS, CSS, images, and font files referenced in the build output into a single self-contained HTML file, suitable for loading in UE5's web browser widget.
Usage:
Corresponding npm script:
Use case:
- After
rspack build, the generated HTML with external resources is processed by this tool - Produces a single self-contained HTML file ready for loading in UE5 with no external dependencies
Using the Template
Development
Start the development server:
This launches a local dev server with hot module replacement for rapid development.
Building
Build the project for production:
The build output will be generated in the dist/merged/ directory as a single HTML file with all assets inlined, ready for use in UE5.
UE5 Integration
After building, the generated HTML file can be loaded in UE5 using the QuickUI plugin's web browser widget, enabling seamless bidirectional communication between React and UE5. UE5 can control frontend page routing by sending custom events (e.g., RouteNavigate), enabling UE5-driven UI navigation.