### Start development server
Source: https://reactunity.github.io/reference
Launches the Webpack Dev Server with Fast Refresh enabled.
```bash
react-unity-scripts start
```
--------------------------------
### Install Material Design Package
Source: https://reactunity.github.io/reference/material
Install the package using npm.
```bash
npm i @reactunity/material
```
--------------------------------
### Install ClearScript via OpenUPM
Source: https://reactunity.github.io/learn/howto/debug
Command to add the ClearScript package to your Unity project root.
```bash
npx openupm-cli add com.reactunity.clearscript
```
--------------------------------
### String Media Query Example
Source: https://reactunity.github.io/reference/media-queries
Compare string-typed properties against specific valid values.
```css
@media (system: windows) or (platform: iphoneplayer) {
...
}
```
--------------------------------
### Rendering a root component
Source: https://reactunity.github.io/reference/api/render
Example of importing the render function and mounting a component at the top level of an application.
```javascript
import { render } from '@reactunity/renderer';
function Hello() {
return
Hello, world! ;
}
render( );
```
--------------------------------
### CSS Pointer Events Styles
Source: https://reactunity.github.io/reference/css/pointer-events
Example CSS configuration for layout alignment and button spacing.
```css
:root {
align-items: center;
}
.test {
flex-direction: row;
align-items: center;
}
.test > button {
margin: 20px;
}
```
--------------------------------
### Numeric Media Query Example
Source: https://reactunity.github.io/reference/media-queries
Perform numeric comparisons using min/max prefixes or standard comparison operators.
```css
@media (aspect-ratio: 1.6) and (1024 >= window-width >= 2160) {
...
}
```
--------------------------------
### Boolean Media Query Example
Source: https://reactunity.github.io/reference/media-queries
Use boolean properties to check for the existence of specific environment states.
```css
@media (full-screen and ugui) {
...
}
```
--------------------------------
### Implement a Todo App in ReactUnity
Source: https://reactunity.github.io/
A complete example demonstrating component structure, state management with hooks, and event handling for a Todo application.
```javascript
import { render } from '@reactunity/renderer';
import { useRef, useState } from 'react';
export function TodoItem(props) {
return
{props.item.text}
props.onRemove(props.item.id)}>
delete
;
}
export function TodoPage() {
const lastId = useRef(3);
const [items, setItems] = useState([
{ id: 0, text: 'Take a walk' },
{ id: 1, text: 'Buy groceries' },
{ id: 2, text: 'Prepare dinner' },
]);
const inputRef = useRef();
function addTodo(item) {
inputRef.current.Value = '';
setItems(oldItems => {
const newItems = [...oldItems];
newItems.push({ id: lastId.current++, text: item });
return newItems;
});
}
function removeTodo(id) {
setItems(oldItems => oldItems.filter(x => x.id !== id));
}
return
TODO app example
addTodo(sender.Value)} />
addTodo(inputRef.current.Value)}>
add
{items.map((item) =>
)}
;
}
render( );
```
--------------------------------
### Apply z-index in CSS
Source: https://reactunity.github.io/reference/css/z-index
Example showing z-index applied to elements on hover to bring them to the front.
```css
:root {
align-items: center;
}
.items {
flex-direction: row;
align-items: center;
margin-top: 20px;
}
.item1 {
width: 100px;
height: 100px;
background-color: coral;
}
.item2 {
width: 80px;
height: 80px;
margin-left: -20px;
background-color: slategray;
}
.item1, .item2 {
transition: scale 200ms;
}
.item1:hover, .item2:hover {
cursor: pointer;
z-index: 10;
scale: 1.1;
}
```
--------------------------------
### CSS Rotate Animation Example
Source: https://reactunity.github.io/reference/css/rotate
Demonstrates various rotation units and 3D rotation syntax within a keyframe animation.
```css
.items {
flex-direction: column;
align-self: flex-start;
margin: 100px auto;
border: 1px solid gray;
}
.item {
width: 100px;
height: 100px;
background-color: coral;
animation: rotateAnim 5s infinite;
}
@keyframes rotateAnim {
0% {
rotate: 1;
}
20% {
rotate: 30deg;
}
40% {
rotate: 1.2rad;
}
60% {
rotate: 0.625turn;
}
80% {
rotate: 45deg 45deg 0.625turn;
}
}
```
--------------------------------
### Define CSS styles for ReactUnity elements
Source: https://reactunity.github.io/reference/css
Example of defining root styles and specific view element styles including hover states.
```css
:root {
justify-content: space-around;
text-align: center;
background-color: #a9b2ba;
}
view {
align-self: center;
width: 100px;
height: 100px;
background-color: coral;
cursor: pointer;
}
view:hover {
background-color: blue;
}
```
--------------------------------
### CSS Translate Animation Example
Source: https://reactunity.github.io/reference/css/translate
Demonstrates using the translate property within keyframes to move an element across different coordinates over time.
```css
.items {
flex-direction: column;
align-self: flex-start;
margin: 100px auto;
border: 1px solid gray;
}
.item {
width: 100px;
height: 100px;
background-color: coral;
animation: translateAnim 4s infinite;
}
@keyframes translateAnim {
0% {
translate: 0px 0px;
}
25% {
translate: 220px 40px;
}
50% {
translate: 200px 200px;
}
75% {
translate: -50px 80px;
}
100% {
translate: 0px 0px;
}
}
```
--------------------------------
### Component Usage
Source: https://reactunity.github.io/reference/components/svg
Example of how to use the component to render a vector graphic with specific dimensions and styling.
```APIDOC
## Component
### Description
The `` component is used to render inline SVG graphics. It requires the `Unity.VectorGraphics` package to be installed in the project.
### Usage
```jsx
```
```
--------------------------------
### Render an inline SVG
Source: https://reactunity.github.io/reference/components/svg
Example of using the component to render a vector graphic with specific dimensions and styling.
```javascript
export default function App() {
return
};
```
--------------------------------
### CSS visibility property usage
Source: https://reactunity.github.io/reference/css/visibility
Example showing how to use the visibility property to hide non-hovered elements within a container.
```css
:root {
align-items: center;
}
.items {
flex-direction: row;
align-items: center;
margin-top: 20px;
cursor: pointer;
}
.items > * {
width: 100px;
height: 100px;
margin: 20px;
}
.items:hover :not(:hover) {
visibility: hidden;
}
```
--------------------------------
### Build project for production
Source: https://reactunity.github.io/reference
Compiles the project into static files for production deployment.
```bash
react-unity-scripts build
```
--------------------------------
### Basic Toggle Implementation
Source: https://reactunity.github.io/reference/components/toggle
Demonstrates a toggle component controlling a global light state.
```javascript
export default function App() {
const light = Globals.Light;
return
light.enabled = val}
value={light.enabled} />
Toggle light
;
};
```
--------------------------------
### Implementing a Video Player with Playback Controls
Source: https://reactunity.github.io/reference/components/video
Uses a ref to access the VideoPlayer instance for manual play/pause control and handles video source loading.
```javascript
import { useState, useEffect } from 'react';
export default function App() {
const videoAddress = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4';
const [videoRef, setVideoRef] = useState();
useEffect(() => {
if (videoRef) {
videoRef.VideoPlayer.Play();
}
}, [videoRef]);
const toggleVideo = () => {
const vp = videoRef.VideoPlayer;
if (vp.isPlaying) vp.Pause();
else vp.Play();
};
return <>
>;
};
```
--------------------------------
### Applying box-shadow styles
Source: https://reactunity.github.io/reference/css/box-shadow
Demonstrates various box-shadow configurations including standard, multi-layered, inset, and blurred shadows.
```css
:root {
padding: 10px;
}
view {
flex-grow: 1;
margin: 20px auto;
background-color: white;
width: 300px;
}
view:nth-child(1) {
box-shadow: 1px 1px 4px 0 black;
}
view:nth-child(2) {
box-shadow: 0 5px 5px -3px rgb(0 0 0 / 20%), 0 8px 10px 1px rgb(0 0 0 / 14%), 0 3px 14px 2px rgb(0 0 0 / 12%);
}
view:nth-child(3) {
border-radius: 50px;
box-shadow: 1px 1px 4px 0 black inset;
}
view:nth-child(4) {
box-shadow: 0 0 4px 3px black;
}
```
--------------------------------
### Implement Tooltips with useDataTooltip
Source: https://reactunity.github.io/reference/material/tooltip
Demonstrates how to register buttons with different tooltip triggers (hover, press, click) and configure positioning using data attributes.
```javascript
import { useDataTooltip, Button } from '@reactunity/material';
import '@reactunity/material/styles';
export default function App() {
const ttHover = useDataTooltip('hover');
const ttPress = useDataTooltip('press');
const ttClick = useDataTooltip('click');
return
Hover
Top
Bottom
Left
Right
Center
Custom
Press
Top
Bottom
Left
Right
Center
Custom
Click
Top
Bottom
Left
Right
Center
Custom
;
}
```
--------------------------------
### Instantiate a Prefab in React
Source: https://reactunity.github.io/reference/components/prefab
Basic usage of the component to render a prefab loaded from globals or resources.
```javascript
export default function App() {
// Load the prefab using globals
const { prefab } = useGlobals();
// or alternatively you can load the prefab from resources
// const prefab = useMemo(() => Interop.UnityEngine.Resources.Load('MyPrefab') as UnityEngine.GameObject, []);
return ;
};
```
--------------------------------
### Applying Opacity with CSS
Source: https://reactunity.github.io/reference/css/opacity
Demonstrates using opacity values with hover states for interactive elements.
```css
:root {
align-items: center;
}
.items {
flex-direction: row;
align-items: center;
}
.item1, .item2, .item3 {
width: 100px;
height: 100px;
transition: opacity 200ms;
cursor: pointer;
margin: 20px;
}
.item1:hover {
opacity: 0.4;
}
.item2:hover {
opacity: 80%;
}
.item3:hover {
opacity: 5%;
}
```
--------------------------------
### Implement Select Component in React
Source: https://reactunity.github.io/reference/material/select
Demonstrates basic usage of the Select component, including single selection, multiple selection, and chip-based multi-selection.
```javascript
import { Select } from '@reactunity/material';
import '@reactunity/material/styles';
export default function App() {
return
Option 1
Option 2
Option 3
Option 4
Option 5
Option 6
Option 7
Option 8
Option 9
Option 10
Option 11
Option 12
Option 13
Option 1
Option 2
Option 3
Option 1
Option 2
Option 3
Option 4
Option 5
;
}
```
--------------------------------
### Toggle and ToggleGroup Usage
Source: https://reactunity.github.io/reference/material/toggle
Demonstrates basic checkbox, indeterminate state, and grouped toggle configurations.
```javascript
import { Toggle, ToggleGroup } from '@reactunity/material';
import '@reactunity/material/styles';
export default function App() {
return
Checkbox
Indeterminate
Radio Group:
Option 1
Option 2
Option 3
Checkbox Group:
Option 1
Option 2
Option 3
;
}
```
--------------------------------
### Basic RawImage implementation
Source: https://reactunity.github.io/reference/components/rawimage
Displays an image from a URL with a fixed height.
```javascript
import { useState, useEffect } from 'react';
export default function App() {
return (
);
};
```
--------------------------------
### Basic Input Component Usage
Source: https://reactunity.github.io/reference/components/input
Demonstrates a standard text input with a default value, margin styling, and an onChange event handler.
```javascript
const defaultValue = 'Default value';
export default function App() {
return console.log(val)} />;
};
```
--------------------------------
### Define static UI with XML
Source: https://reactunity.github.io/learn
Uses HTML-like syntax to define static UI structures that can be modified programmatically.
```xml
Hello, Divyesh!
Hello, Sarah!
Hello, Taylor!
```
--------------------------------
### VSCode Launch Configuration for ClearScript
Source: https://reactunity.github.io/learn/howto/debug
Configuration for launch.json to attach the VSCode debugger to the ClearScript engine on port 9222.
```json
{
"name": "Attach to ClearScript on port 9222",
"type": "node",
"port": 9222,
"request": "attach",
"pauseForSourceMap": true,
"resolveSourceMapLocations": null,
"skipFiles": [
"/**",
"node_modules/**"
]
}
```
--------------------------------
### Import Material Design Components
Source: https://reactunity.github.io/reference/material
Import global styles once and use either individual components or the full library namespace.
```javascript
// Global styles is needed to be imported at least once for correct styling
import '@reactunity/material/styles';
// Importing a specific component:
import { Button } from '@reactunity/material';
// Importing all components together:
import * as Material from '@reactunity/material';
```
--------------------------------
### Animating Background Color in CSS
Source: https://reactunity.github.io/reference/css/background-color
Demonstrates using keyframes to transition between different background color formats over time.
```css
.test {
width: 240px;
height: 160px;
margin: 40px auto;
border: 1px solid black;
animation: backgroundColorAnim 8s infinite;
}
@keyframes backgroundColorAnim {
0% {
background-color: crimson;
}
25% {
background-color: #a5a5a5;
}
50% {
background-color: rgba(10, 10, 235, 0.4);
}
75% {
background-color: #00ff0033;
}
100% {
background-color: crimson;
}
}
```
--------------------------------
### Animating Border Width in CSS
Source: https://reactunity.github.io/reference/css/border-width
Demonstrates how to animate the border-width property and individual side widths using keyframes.
```css
.test {
width: 240px;
height: 160px;
margin: 40px auto;
background-color: coral;
animation: borderWidthAnim 4s infinite;
}
@keyframes borderWidthAnim {
0% {
border-width: 20px;
}
25% {
border-width: 20px;
border-bottom-width: 0;
}
50% {
border-width: 20px 60px 0 20px;
border-radius: 0;
}
75% {
border-width: 10px;
border-bottom-width: 40px;
border-radius: 40px;
}
100% {
border-width: 20px;
border-radius: 0;
}
}
```
--------------------------------
### Randomize background color using Interop
Source: https://reactunity.github.io/learn/howto/interop
Demonstrates calling the Unity Color constructor directly from JavaScript using the Interop namespace.
```javascript
export default function App() {
const ref = React.useRef();
const randomize = () => {
const r = Math.random();
const g = Math.random();
const b = Math.random();
const color = new Interop.UnityEngine.Color(r, g, b);
ref.current.Style.backgroundColor = color;
};
return <>
Randomize color
>;
}
```
--------------------------------
### Basic view component usage
Source: https://reactunity.github.io/reference/components/view
Defines a container with custom padding, background color, and text content.
```javascript
export default function App() {
return
Hello world
;
};
```
--------------------------------
### Basic Anchor Component Usage
Source: https://reactunity.github.io/reference/components/anchor
Displays an anchor component that navigates to a GitHub URL with custom margin styling.
```javascript
export default function App() {
return
Go to GitHub
;
};
```
--------------------------------
### Implement Dialog Components in React
Source: https://reactunity.github.io/reference/material/dialogs
Demonstrates the usage of AlertDialog, ConfirmDialog, and PromptDialog components with state-based visibility toggling.
```javascript
import { Button, AlertDialog, ConfirmDialog, PromptDialog } from '@reactunity/material';
import '@reactunity/material/styles';
export default function App() {
const [dlOpen, setDlOpen] = React.useState(0);
return
setDlOpen(1)}>Open Alert With Text Only
setDlOpen(2)}>Open Alert With Title Only
setDlOpen(3)}>Open Alert With Text & Title
setDlOpen(0)} backdropClose text={'Some alert text'} />
setDlOpen(0)} backdropClose title={'Some alert title'} />
setDlOpen(0)} backdropClose text={'Some alert text'} title={'Some alert title'} />
setDlOpen(4)}>Open Confirm With Text Only
setDlOpen(5)}>Open Confirm With Title Only
setDlOpen(6)}>Open Confirm With Text & Title
setDlOpen(0)} backdropClose text={'Some confirm text'} />
setDlOpen(0)} backdropClose title={'Some confirm title'} />
setDlOpen(0)} backdropClose text={'Some confirm text'} title={'Some confirm title'} />
setDlOpen(7)}>Open Prompt With Text Only
setDlOpen(8)}>Open Prompt With Title Only
setDlOpen(9)}>Open Prompt With Text & Title
setDlOpen(0)} backdropClose text={'Some prompt text'} />
setDlOpen(0)} backdropClose title={'Some prompt title'} />
setDlOpen(0)} backdropClose text={'Some prompt text'} title={'Some prompt title'} />
```
--------------------------------
### Render a React component
Source: https://reactunity.github.io/reference
Initializes the ReactUnity renderer to display UI elements.
```javascript
import { render } from '@reactunity/renderer';
render(Hello world! )
```
--------------------------------
### Basic Image Component Usage
Source: https://reactunity.github.io/reference/components/image
Displays an image from a URL with specific height and object-fit styling.
```javascript
export default function App() {
const imageAddress = 'https://picsum.photos/200';
return ;
};
```
--------------------------------
### Create a custom UGUI component
Source: https://reactunity.github.io/learn/howto/extending
Define a custom component class by extending UGUIComponent or its derivatives like ButtonComponent.
```csharp
using ReactUnity.Styling;
using ReactUnity.UGUI;
using UnityEngine;
public class CustomButtonComponent : ButtonComponent
{
public CustomButtonComponent(UGUIContext context, Color backgroundColor) : base(context)
{
Style[StyleProperties.backgroundColor] = backgroundColor;
}
}
```
--------------------------------
### Configure link.xml for code stripping
Source: https://reactunity.github.io/learn/howto/troubleshooting
Use a link.xml file to prevent Unity from stripping engine modules or assemblies required by ReactUnity.
```xml
```
--------------------------------
### Implement Card with Elevation
Source: https://reactunity.github.io/reference/material/card
Displays multiple Card components with varying elevation levels to demonstrate depth.
```javascript
import { Card } from '@reactunity/material';
import '@reactunity/material/styles';
export default function App() {
return
Card with elevation 1
Card with elevation 3
Card with elevation 8
;
}
```
--------------------------------
###
Source: https://reactunity.github.io/reference/components/image
The component renders an image from a specified source. It supports various source types and CSS-based tinting.
```APIDOC
##
### Description
Displays an image component. Alternatively, use for raw images or for SVG files (requires Unity.VectorGraphics package).
### Properties
- **source** (string|Texture2D|Sprite) - Required - The source of the image. Can be a URL, a resource path (e.g., 'res:path/to/file'), a Texture2D object, or a Sprite object.
### Notes
- The CSS `color` property can be used to tint the image.
### Example
```jsx
```
```
--------------------------------
### Rich-Text Configuration
Source: https://reactunity.github.io/reference/components/text
Demonstrates enabling and disabling rich-text formatting within the component.
```javascript
const name = 'John Doe';
export default function App() {
return <>
{`Yes! This is <#998855>rich-text with color`}
{`Sorry, no rich-text here`}
>;
};
```
--------------------------------
### Animating Border Radius in CSS
Source: https://reactunity.github.io/reference/css/border-radius
Demonstrates using keyframes to animate the border-radius property and individual corner radii over time.
```css
.test {
width: 240px;
height: 160px;
margin: 40px auto;
background-color: cornflowerblue;
animation: borderRadiusAnim 6s infinite;
}
@keyframes borderRadiusAnim {
0% {
border-radius: 20%;
}
25% {
border-radius: 50%;
}
50% {
border-radius: 50%;
border-top-left-radius: 20%;
border-bottom-right-radius: 20%;
}
75% {
border-radius: 20%;
border-bottom-left-radius: 0;
}
100% {
border-radius: 20%;
}
}
```
--------------------------------
### Basic Accordion Implementation
Source: https://reactunity.github.io/reference/material/accordion
A standard implementation of the Accordion component using the @reactunity/material library.
```javascript
import { Accordion } from '@reactunity/material';
import '@reactunity/material/styles';
export default function App() {
return
This is the accordion summary
Accordion content
;
}
```
--------------------------------
### Load HTML content from a URL
Source: https://reactunity.github.io/reference/components/html
Use the source property to fetch and render HTML content from a remote URL.
```javascript
const url = 'https://reactunity.github.io/examples/html-content.html';
export default function App() {
return ;
};
```
--------------------------------
### Slider Component Implementation
Source: https://reactunity.github.io/reference/material/slider
Demonstrates various Slider configurations including horizontal and vertical orientations, normal and diff modes, and step increments.
```javascript
import { Slider } from '@reactunity/material';
import '@reactunity/material/styles';
export default function App() {
return
;
}
```
--------------------------------
### Applying content to elements and pseudo-elements
Source: https://reactunity.github.io/reference/css/content
Demonstrates using the content property within CSS classes and pseudo-element selectors.
```css
.test {
border: 1px solid black;
padding: 12px;
flex-direction: row;
}
.test:hover text {
content: "Inside content!";
}
.test:before {
content: "Before content!";
margin-right: 10px;
}
.test:after {
content: "After content!";
margin-left: 10px;
}
```
--------------------------------
### Pass Custom Properties and Events to a Prefab
Source: https://reactunity.github.io/reference/components/prefab
Configure the component with custom properties and event listeners to interact with the target component.
```javascript
export default function App() {
const prefab = useMemo(() => Interop.UnityEngine.Resources.Load('MyPrefab') as UnityEngine.GameObject, []);
return (
console.log('Something happened', val)}
/>
);
};
```
--------------------------------
### Applying appearance property in React
Source: https://reactunity.github.io/reference/css/appearance
Demonstrates applying the appearance property directly to button elements using inline styles.
```javascript
export default function App() {
return <>
Click the buttons to see style differences
Appearance: button
Appearance: none
>;
}
```
--------------------------------
### Applying Scale in CSS Keyframes
Source: https://reactunity.github.io/reference/css/scale
Demonstrates using the scale property within a keyframe animation to transition between uniform and non-uniform scaling states.
```css
.items {
flex-direction: column;
align-self: flex-start;
margin: 100px auto;
border: 1px solid gray;
}
.item {
width: 100px;
height: 100px;
background-color: coral;
animation: scaleAnim 4s infinite;
}
@keyframes scaleAnim {
0% {
scale: 1;
}
25% {
scale: 2.2;
}
50% {
scale: 3.4 1;
}
75% {
scale: 0.5;
}
100% {
scale: 1;
}
}
```
--------------------------------
### Apply CSS color property
Source: https://reactunity.github.io/reference/css/color
Demonstrates applying different color formats including named colors, hex codes, and rgba values to elements.
```css
view {
flex-grow: 1;
justify-content: center;
font-size: 48px;
}
view:nth-child(1) {
color: crimson;
}
view:nth-child(2) {
color: #a5a5a5;
}
view:nth-child(3) {
color: rgba(10, 10, 235, 0.7);
}
view:nth-child(4) {
color: #550055aa;
}
```
--------------------------------
### Animating Border Colors in CSS
Source: https://reactunity.github.io/reference/css/border-color
Demonstrates using border-color and specific side-color properties within a keyframe animation to change border appearance over time.
```css
.test {
width: 240px;
height: 160px;
margin: 40px auto;
background-color: cornflowerblue;
border-width: 30px;
animation: borderColorAnim 8s infinite;
}
@keyframes borderColorAnim {
0% {
border-color: black;
}
25% {
border-color: transparent;
border-bottom-color: #ff7edb;
}
50% {
border-color: black;
border-right-color: rgba(130, 85, 255, 0.363);
border-bottom-color: hsla(46, 100%, 50%, 0.8);
border-radius: 0;
}
75% {
border-color: gold;
border-bottom-color: red;
border-radius: 60px;
}
100% {
border-color: black;
border-radius: 0;
}
}
```
--------------------------------
### Load script content from a URL
Source: https://reactunity.github.io/reference/components/script
Uses the source property to fetch and execute JavaScript from an external URL.
```javascript
const url = 'https://reactunity.github.io/examples/script-content.js';
export default function App() {
return <>
Styled text
>;
};
```
--------------------------------
### Component
Source: https://reactunity.github.io/reference/components/prefab
The component instantiates a target prefab and allows passing custom properties and event handlers.
```APIDOC
##
### Description
Instantiates a custom prefab as a React component. It supports passing custom properties and event listeners to the prefab instance.
### Props
- **target** (UnityEngine.GameObject) - Required - The prefab object to instantiate.
- **custom** (Object) - Optional - An object containing properties to be passed to the prefab target component via `SetProperty`.
- **on[EventName]** (Function) - Optional - Event handlers invoked when `FireEvent` is called from the prefab target component.
```
--------------------------------
### Component
Source: https://reactunity.github.io/reference/components/input
The component is used to capture text input from the user. It supports setting an initial value and listening for changes via the onChange event.
```APIDOC
## Component
### Description
Creates a text input component for user interaction.
### Properties
- **onChange** (function) - An event fired when the string in the input is changed by the user.
- **value** (string) - The initial value displayed in the input field.
### Usage Example
```jsx
console.log(val)}
/>
```
```
--------------------------------
### Basic render usage
Source: https://reactunity.github.io/reference/api/render
Renders a JSX element into the renderer.
```javascript
render( );
```
--------------------------------
### Configure tsconfig.json for UI Backend
Source: https://reactunity.github.io/learn/ui-backends
Required configuration in tsconfig.json to enable correct component types for the chosen UI backend.
```json
"jsxImportSource": "@reactunity/renderer/ugui"
"types": [
"@reactunity/scripts/main"
]
```
--------------------------------
### Component
Source: https://reactunity.github.io/reference/components/video
The component renders a video player. It accepts a source property and provides a reference to the VideoPlayer instance for programmatic control.
```APIDOC
## Component
### Description
The `` component is used to embed and control video playback within the application.
### Properties
- **source** (string/Video object) - Required - The source of the video, which can be a URL or a Video object.
- **ref** (function) - Optional - A callback to receive the component reference, which provides access to the `VideoPlayer` object.
### VideoPlayer Methods
- **Play()** - Starts video playback.
- **Pause()** - Pauses video playback.
### VideoPlayer Properties
- **isPlaying** (boolean) - Indicates whether the video is currently playing.
```
--------------------------------
###
Source: https://reactunity.github.io/reference/components/anchor
The component renders a button that opens the provided URL upon being clicked.
```APIDOC
##
### Description
A special button component that opens the given link when clicked.
### Props
- **url** (string) - Required - The destination URL to open when the anchor is clicked.
- **style** (object) - Optional - CSS styles to apply to the anchor component.
### Usage Example
```jsx
Go to GitHub
```
```
--------------------------------
### Component Properties
Source: https://reactunity.github.io/reference/components/html
The component accepts either a content string or a source URL to render UI elements.
```APIDOC
## Component
### Description
Renders html-like content. Supports