Version: latest

PortalIcon

Description

The PortalIcon component represents a portal icon for use in the on-device app Launcher.

Example

import React from "react";
import { View, PortalIcon } from "magic-script-components";
export default class MyApp extends React.Component {
render() {
return (
<View name="main-view">
<PortalIcon text="Portal Icon" iconSize="extra-large" />
</View>
);
}
}

Common Events

Common Properties

Create Properties

NameTypeDefault ValueRequiredDescription
textstringn/aYThe default, UTF-8 encoded portal icon label text.
iconSizestringsmallNOne of the built-in sizes for the portal icon.

Element Properties

NameTypeDefault ValueDescription
hoverScalenumber1Sets the overall hover scale of the portal icon component. This value is provided as a multiplier, with 1 being normal scale, 2 being scaled two times normal, etc.
hoverZOffsetnumber0Sets the overall hover Z-offset of the portal icon component. This value is provided in local space to the portal icon component's +Z axis. Positive values move towards the camera.
iconActivateAnimationstringn/aSets the icon activate animation name (optional). This is the animation played when the user opens the app.
iconContextMenuAnimationstringn/aSets the icon context menu animation name (optional). This is the animation played when the user opens the app settings.
iconHoverAnimationstringn/aSets the icon hover animation name (optional). This is the animation played when the user hovers on the icon, but no action is taken.
iconIdleAnimationstringn/aSets the icon idle animation name (required). This is the default animation state when the user is not interacting with the icon.
iconHoverPositionvec3n/aSets the icon hover position relative to the portal sphere. This value is specified in local space to the portal component and is scaled with the rest of the portal elements during hover scale animation.
labelDisplayModestringalwaysSets the display mode for the portal icon label. The default value is kAlways, to always show the label.

iconSize options: PortalIconSize

labelDisplayMode options: LabelDisplayMode