UI Notification
Updated
Notification card with icon, title, text and buttons.
- Type
comp-ui-notification- Script class
UINotificationComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Notifications: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
actionsGap |
0 ≤ x ≤ 16384 |
|
actions[]. |
0 ≤ x ≤ 4096 |
|
actions[]. |
||
actions[]. |
0 ≤ x ≤ 16384 |
|
content |
0 ≤ x ≤ 4096 |
|
content |
0 ≤ x ≤ 1 |
|
iconSize |
0 ≤ x ≤ 4096 |
|
progress |
0 ≤ x ≤ 1 |
|
progress |
0 ≤ x ≤ 16384 |
|
titleFontSize |
0 ≤ x ≤ 4096 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
UINotification::openUINotification::actionUINotification::dismiss
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Reset asks first: a Warning notification with Cancel and Reset actions reports the answer on its signal, and the script reads the UI Notification component of the dialog it opened. A tip above the crates is a UI Notification entity pinned in the world.
Press Scatter crates, then Reset level: a dialog asks first. Press Reset to send the crates home, or Cancel or a press outside it to keep them. Drag outside the panels to orbit the camera.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(UINotificationComponent); if (component) log(component.props);}