New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@epigraph/ar

Package Overview
Dependencies
Maintainers
4
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epigraph/ar

Epigraph's custom web component for AR based on Google's `<model-viewer>`. As such, it mostly follows their coding conventions except for public APIs. For more information, @see https://github.com/google/model-viewer/wiki/Code-conventions

latest
npmnpm
Version
2.11.6
Version published
Maintainers
4
Created
Source

epigraph-ar

Epigraph's custom web component for AR based on Google's <model-viewer>. As such, it mostly follows their coding conventions except for public APIs. For more information, @see https://github.com/google/model-viewer/wiki/Code-conventions

Examples

Quick Start with the latest stable version
<!-- include this in your `<head>` -->
<script async type="module" src='https://cdn.jsdelivr.net/npm/@epigraph/ar/dist/epigraph-ar.min.js'></script>
Quick Start with a Specific Version
<!-- include this in your `<head>`, replace 2.9.0 with a specified version -->
<script async type="module" src='https://cdn.jsdelivr.net/npm/@epigraph/ar@2.9.0/dist/epigraph-ar.min.js'></script>
epigraph-ar as an AR button
<epigraph-ar sku="some-valid-sku" ua-code="some-valid-ua-code" ga-measurement-id="some-valid-ga-measurement-id" ar-modes="scene-viewer quick-look"></epigraph-ar>
epigraph-ar as a standalone 3D viewer
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" ga-measurement-id="some-valid-ga-measurement-id" button-mode="none"></epigraph-ar>
epigraph-ar as a standalone 3D viewer with material variant selector
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" ga-measurement-id="some-valid-ga-measurement-id" button-mode="none" material-variant-selector-visible></epigraph-ar>
epigraph-ar as a standalone 3D viewer with material variant selector and AR
<!-- NOTE: only supported on Android Devices compatible with WebXR -->
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" ga-measurement-id="some-valid-ga-measurement-id" ar-modes="webxr scene-viewer quick-look" material-variant-selector-visible></epigraph-ar>
epigraph-ar as a standalone 3D viewer with product tour
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" ga-measurement-id="some-valid-ga-measurement-id" button-mode="none" product-tour-visible></epigraph-ar>
epigraph-ar with product tour and AR
<epigraph-ar viewer-visible sku="some-valid-sku" ua-code="some-valid-ua-code" ga-measurement-id="some-valid-ga-measurement-id" product-tour-visible></epigraph-ar>
Using a slot
<epigraph-ar>
<element slot="slot-name"></element>
<epigraph-ar>
Using a CSS Shadow Part
epigraph-ar::part(part-name) {
some-rule: some-value;
}
Using a CSS Custom Property
epigraph-ar {
--some-css-property: some-new-value;
}
Listening to Events
const epigraphAR = document.querySelector('epigraph-ar');

epigraphAR.addEventListener('event-name', () => {
doSomething();
})

Properties

PropertyAttributeModifiersTypeDefaultDescription
arButtonModeAttributebutton-modestring"mobile desktop"sets ar button modes for the ar-button, maps to the enumeration

empty string - NONE

mobile - MOBILE

desktop - DESKTOP

mobile desktop - BOTH
arButtonRolloverNudgear-button-rollover-nudgebooleanfalsetoggles the ability to show a

rollover nudge when the AR/QR button is hovered
arModesar-modesstring"scene-viewer quick-look"sets ar modes for the ar experience

webxr/scene-viewer - android

quick-look - iOS
arPlacementar-placementstring"floor"sets ar placement for the ar experience

floor - place ar object on the floor

wall - place ar object on the wall
autoStartauto-startbooleanfalseused to load the 3D viewer automatically on desktop
cameraOrbitcamera-orbitstring"55deg 69deg auto"sets the viewer camera orbit values
canActivateARreadonlypublic method to get ar-capability status
environmentImageenvironment-imagestring"neutral"sets environmental lighting

empty string - default scene optimized for load speed

neutral - applies even lighting on all sides

HDR Image - supply HDR Image source url to this to apply custom lighting
gaEventLabelTypega-event-label-typestring"name"flag to use different values for GA event label

name - use product name or hotspot feature name

sku - use product sku

name and sku - use '{name} - {sku}'

sku and name - use '{sku} - {name}'
interactionPromptThresholdinteraction-prompt-thresholdnumber3000flag to toggle UserWithArSupport/UserWithQrSupport GA event reporting
internalMeasurementsVisibleinternal-measurements-visiblebooleanfalsesets visibility of internal model measurements
materialVariantSelectorVisiblematerial-variant-selector-visiblebooleanfalsesets visibility of material variant selector
maxCameraOrbitmax-camera-orbitstring"auto 100deg auto"sets the maximum camera orbit

each part of the string represents the following in order: roll(theta) yaw(phi) radius

this uses Euler angles @see https://en.wikipedia.org/wiki/Euler_angles#Proper_Euler_angles_2 for more information
measurementUnitmeasurement-unitstring"imperial"sets which measurement system to use for internal measurements

imperial - uses the imperial system

metric - uses the metric system
minCameraOrbitmin-camera-orbitstring"auto 0deg auto"sets the minimum camera orbit

each part of the string represents the following in order: roll(theta) yaw(phi) radius

this uses Euler angles @see https://en.wikipedia.org/wiki/Euler_angles#Proper_Euler_angles_2 for more information
namestring"EPIGRAPH-AR"name to be used for the internal logging service
orbitSensitivityorbit-sensitivitynumber"1"sets the orbit sensitivity

takes any number, negative values reverse orbit
posterBackgroundposterstring""sets the source url for the poster background
posterForegroundposter-foregroundstring""sets the source url for the icon to display on top of the poster
mobilePosterForegroundmobile-poster-foregroundstring""sets the source url for the icon to display on top of the poster on mobile devices, defaults to the value of poster-foreground if none are provided
productTourVisibleproduct-tour-visiblebooleanfalsesets visibility of product tour
shadowIntensityshadow-intensitynumber1modifies the shadow intensity of the model
showPosterOnCloseshow-poster-on-closebooleanfalsesets ability to reset model-viewer to poster upon closing fullscreen
skuskustring""to be used with epigraph product skus
stopTouchPropagationstop-touch-propagationbooleanfalsemodifies whether touch events on the 3D viewer are allowed to propagate
themethemestring"default"used to indicate UI/UX themes
uaCodeua-codestring""to be used with client ua-code
gaMeasurementIdga-measurement-idstring""to be used with client ga-measurement-id
verboseLoggingverbose-loggingbooleanfalseused to log debugging information
viewerVisibleviewer-visiblebooleanfalsesets visibility of the 3D viewer
TODO: set a
method call to toggle this property based on response from mediator
disableMobileFullscreendisable-mobile-fullscreenbooleanfalseused to disable fullscreen on mobile devices

Methods

MethodTypeDescription
dismissPoster(): voidpublic method to dismiss viewer poster
showPoster(): voidpublic method to show viewer poster
closeModal(): voidpublic method to close iOS fullscreen modal
launchFullscreen(): voidpublic method to open fullscreen or fullscreen modal

Events

EventTypeDescription
epigraph-ar-capability-determinedCustomEvent<{ canActivateAr: any; }>custom event to indicate whether the device is AR capable
epigraph-ar-loading-errorCustomEvent<{ message: any; stack: any; }>custom event to bubble up the model load error event from model-viewer, inheriting message and stack
epigraph-ar-model-loadedcustom event to bubble up the model loaded event from model-viewer
epigraph-experience-typeCustomEvent<ExperienceDetails>custom event to detail what experience is currently being rendered
epigraph-invalid-productcustom event to indicate product associated with the sku is invalid
epigraph-valid-productcustom event to indicate product associated with the sku is valid
epigraph-ar-poster-dismissedcustom event to indicate when the model-viewer poster is dismissed
epigraph-ar-fullscreen-openedcustom event to indicate when fullscreen is opened on the model-viewer
epigraph-ar-fullscreen-closecustom event to indicate when fullscreen is closed on the model-viewer
epigraph-modal-openedcustom event to indicate when the ios fullscreen modal is opened
epigraph-modal-closecustom event to indicate when the ios fullscreen modal is closed

Slots

NameDescription
ar-buttonreplaces the ar-button but maintains the onclick function
ar-button-rollover-nudgereplaces the rollover nudge that appears onhover, if enabled
mobile-product-tour-buttonreplaces the mobile product tour launch button
posterreplaces the viewer poster
poster-foregroundreplaces the poster icon
mobile-poster-foregroundreplaces the mobile poster icon
progress-barreplaces the progress indicator
qr-modal-closereplaces the qr-modal close button
qr-modal-donereplaces the qr-modal done button
qr-modal-instructionreplaces the qr-modal instruction
qr-modal-requirementreplaces the qr-modal requirement
qr-modal-titlereplaces the qr-modal title
viewer-modal-exit-buttonreplaces the button that exits the fullscreen viewer

CSS Shadow Parts

PartDescription
ar-button-containerpoints to the ar button container
ar-button-rollover-nudgepoints to the rollover nudge that displays on hover
default-ar-buttonpoints to the default ar button
default-poster-foregroundpoints to the default poster icon
default-poster-backgroundpoints to the default poster background
default-poster-background-imagepoints to the default poster background image
hotspot-buttonpoints to the hotspot buttons
hotspot-button-annotationpoints to the hotspot button annotation
hotspot-button-inner-circlepoints to the inner circle of the hotspot button
material-variant-selectorpoints to the <material-variant-selector> element
material-variant-selector-buttonpoints to the selector buttons themselves
material-variant-selector-containerpoints to the container housing the selectors
mobile-product-tour-button-defaultpoints to the default mobile product tour launch button
model-viewerpoints to the <model-viewer> element
poster-foregroundpoints to the poster icon
poster-foreground-imagepoints to the poster icon image
mobile-poster-foregroundpoints to the mobile poster icon
mobile-poster-foreground-imagepoints to the mobile poster icon image
product-tourpoints to the <product-tour> element
product-tour-carousel-mediapoints to the media housed inside media carousels
product-tour-close-containerpoints to the side panel close button container
product-tour-close-defaultpoints to the side panel default close button
product-tour-containerpoints to the side panel container
product-tour-feature-content-containerpoints to the side panel feature content containers
product-tour-feature-descriptionpoints to the description of the feature text
product-tour-feature-media-containerpoints to the containers housing feature media
product-tour-feature-text-containerpoints to the container housing the feature text
product-tour-feature-titlepoints to the title of the feature text
product-tour-inner-content-containerpoints to the side panel inner content container
product-tour-media-carouselpoints to the feature media carousels
product-tour-media-carousel-dotpoints to the control buttons for the media carousels
product-tour-media-controls-containerpoints to the containers housing the control buttons for the media carousels
product-tour-media-titlepoints to the feature media titles
qr-modalpoints to the <qr-modal> element
qr-modal-backgroundpoints to the modal background
qr-modal-close-defaultpoints to the default close button in the qr-modal
qr-modal-containerpoints to the main modal
qr-modal-done-defaultpoints to the default done button in the qr-modal
qr-modal-instruction-defaultpoints to the default instruction in the qr-modal
qr-modal-qr-containerpoints to the qr container within the qr-modal
qr-modal-qr-imagepoints to the qr image in the modal
qr-modal-requirement-defaultpoints to the default requirement in the qr-modal
qr-modal-title-defaultpoints to the default title in the qr-modal
viewer-modal-exit-buttonpoints to the button that exits the fullscreen viewer on mobile
webxr-bannerpoints to the webxr banner
webxr-banner-namepoints to the product name in the text portion
webxr-banner-pdppoints to the the url text below the name in the text portion
webxr-banner-textpoints to the text portion of the webxr banner
webxr-banner-visit-buttonpoints to the visit button in the banner

CSS Custom Properties

PropertyDescription
--ar-button-active-background-coloredits ar-button background color when clicked
--ar-button-background-coloredits ar-button background color
--ar-button-border-coloredits ar-button border color
--ar-button-hover-background-coloredits ar-button background color when hovered
--ar-button-hover-text-coloredits ar-button text color when hovered
--ar-button-text-coloredits ar-button text color
--ar-icon-frame-coloredits ar-icon frame color
--ar-icon-hover-frame-coloredits ar-icon frame color when hovered
--ar-icon-hover-vector-1-coloredits ar-icon vector 1 color when hovered
--ar-icon-hover-vector-2-coloredits ar-icon vector 2 color when hovered
--ar-icon-hover-vector-3-coloredits ar-icon vector 3 color when hovered
--ar-icon-vector-1-coloredits ar-icon vector 1 (top face) color
--ar-icon-vector-2-coloredits ar-icon vector 2 (left face) color
--ar-icon-vector-3-coloredits ar-icon vector 3 (right face) color
--hotspot-button-background-coloredits hotspot button background color
--hotspot-button-border-coloredits hotspot button border color
--hotspot-button-focus-border-coloredits hotspot button border color when focused
--hotspot-inner-circle-border-coloredits hotspot button inner circle border color
--hotspot-inner-circle-viewed-border-coloredits hotspot button inner circle border color when viewed
--mobile-product-tour-button-background-coloredits product-tour mobile button background color
--mobile-product-tour-button-text-coloredits product-tour mobile button text color
--product-tour-background-coloredits product-tour background color
--product-tour-close-button-fill-coloredits product-tour close button fill color
--product-tour-close-button-hover-fill-coloredits product-tour close button fill color when hovered
--product-tour-close-button-hover-stroke-coloredits product-tour close-button stroke color when hovered
--product-tour-close-button-stroke-coloredits product-tour close-button stroke color
--product-tour-current-dot-background-coloredits product-tour control dot background color when it points to a current image
--product-tour-dot-background-coloredits product-tour control dot background color
--model-viewer-mobile-close-button-outline-coloredits product-tour mobile close button outline color
--model-viewer-mobile-close-button-stroke-coloredits product-tour mobile close button stroke color
--progress-ring-coloredits the progress ring color
--progress-ring-radiusedits the progress ring radius
--progress-ring-thicknessedits the progress ring thickness
--qr-modal-close-button-stroke-coloredits qr-modal close button stroke color
--qr-modal-done-button-active-background-coloredits qr-modal done button background color when clicked
--qr-modal-done-button-background-coloredits qr-modal done button background color
--qr-modal-done-button-border-coloredits qr-modal done button border color
--qr-modal-done-button-hover-background-coloredits qr-modal done button background color when hovered
--qr-modal-done-button-hover-text-coloredits qr-modal done button text color when hovered
--qr-modal-done-button-text-coloredits qr-modal done button text color
--qr-modal-instruction-coloredits qr-modal instruction text color
--qr-modal-requirement-coloredits qr-modal requirement text color
--qr-modal-title-coloredits qr-modal title text color

Keywords

web-components

FAQs

Package last updated on 11 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts