Widget:ModelViewer: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<model-viewer | <model-viewer | ||
src="<!--{$src|escape}-->" | src="<!--{$src|escape}-->" | ||
Line 55: | Line 54: | ||
> | > | ||
</model-viewer> | </model-viewer> | ||
<noinclude> | <noinclude> |
Revision as of 00:55, 31 July 2025
<model-viewer
src="" alt="" width="" height="" poster="" loading="" reveal="" with-credentials auto-rotate auto-rotate-delay="" rotation-per-second="" camera-controls camera-orbit="" camera-target="" field-of-view="" min-camera-orbit="" max-camera-orbit="" min-field-of-view="" max-field-of-view="" interaction-prompt="" interaction-prompt-style="" interaction-prompt-threshold="" touch-action="" disable-zoom disable-pan disable-tap bounds="" animation-name="" animation-crossfade-duration="" autoplay variant-name="" orientation="" scale="" environment-image="" skybox-image="" shadow-intensity="" shadow-softness="" exposure="" tone-mapping="" ar ar-modes="" ar-scale="" ar-placement="" ios-src="" xr-environment style="background-color: ;" generate-schema
<button slot="ar-button"></button> >
</model-viewer>
Embeds a 3D model using the <model-viewer> web component. Supports many configuration parameters like camera controls, AR, environment, and animations.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Source | src | URL to the 3D model file (e.g., .glb or .gltf). | String | required |
Alt text | alt | Alternative text describing the model.
| String | optional |
Width | width | Width of the viewer (e.g., '100%' or '500px').
| String | optional |
Height | height | Height of the viewer (e.g., '300px').
| String | optional |
Poster image | poster | URL to an image displayed before the model loads. | String | optional |
Loading | loading | Loading behavior ('eager' or 'lazy'). | String | optional |
Reveal | reveal | When to reveal the model ('auto', 'interaction'). | String | optional |
With credentials | withCredentials | Use cross-origin credentials when fetching resources. | Boolean | optional |
Auto-rotate | autoRotate | Automatically rotate the model. | Boolean | optional |
Auto-rotate delay | autoRotateDelay | Delay before auto-rotation starts, in milliseconds. | String | optional |
Camera controls | cameraControls | Allow user to control camera. | Boolean | optional |
Background color | backgroundColor | CSS color value for the viewer background. | String | optional |
AR mode | ar | Enable AR features. | Boolean | optional |
iOS source | iosSrc | URL to the USDZ model for AR on iOS. | String | optional |
AR button text | arButtonText | Custom text for the AR button. | String | optional |
Loading text | loadingText | Custom text to display while loading. | String | optional |
Error text | errorText | Custom text to display if loading fails. | String | optional |