Skip to content

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.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
actionsGap 0 ≤ x ≤ 16384
actions[].fontSize 0 ≤ x ≤ 4096
actions[].padding
actions[].padding[] 0 ≤ x ≤ 16384
contentFontSize 0 ≤ x ≤ 4096
contentOpacity 0 ≤ x ≤ 1
iconSize 0 ≤ x ≤ 4096
progress 0 ≤ x ≤ 1
progressHeight 0 ≤ x ≤ 16384
titleFontSize 0 ≤ x ≤ 4096

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • UINotification::open
  • UINotification::action
  • UINotification::dismiss

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(UINotificationComponent);
if (component) log(component.props);
}