JavaScript
What @vizbl/core-ar exports, the script tag build and the element's properties.
@vizbl/core-ar uses React 19 inside and runs on any page, whatever framework it uses. Its element takes the attributes.
registerCoreArWidgets()
import { registerCoreArWidgets } from '@vizbl/core-ar'
registerCoreArWidgets()Defines <vizbl-core> in the page's custom element registry. Call it in the browser; a second call, or a call after the script tag build has defined the element, does nothing. On the server it does nothing either.
Exports
| Export | What it is |
|---|---|
registerCoreArWidgets() | Defines <vizbl-core>. |
CORE_AR_WIDGET_TYPES | ['advanced-ar', 'ar-one-click', 'ar-viewer'], the values of type. |
CoreArWidgetType | The type of those values. |
CoreArWidgetState | 'loading' | 'ready' | 'opening' | 'error', the values of data-state. |
CoreArWidgetEventDetail | The detail of the events. |
CoreArWidgetErrorCode | The error codes. |
Properties
Two attributes have a property on the element as well:
| Property | Attribute | Type |
|---|---|---|
triggerClass | trigger-class | string |
unstyled | unstyled | boolean |
Every other attribute is set with setAttribute.
Script tag build
<script async src="https://cdn.vizbl.com/@vizbl/core-ar/dist/core-ar.embed.min.js"></script>The build defines <vizbl-core> as soon as it runs and brings everything it needs; the 3D viewer and AR load from the same CDN on the first tap. The address always serves the latest version.