Skip to content

3D Model Preview

You can preview 3D models (STL, OBJ, GLTF/GLB) directly in your documentation using the ModelViewer component.

First, place your 3D files in the public directory of your project. For example, public/models/my-part.stl.

Then, use the component in your MDX file:

import ModelViewer from '../../../components/ModelViewer';
<ModelViewer client:load src="/models/example.stl" alt="My 3D Part" />
Example STL
Example OBJ
Example GLB
  • STL: Standard Tessellation Language, common for 3D printing.
  • OBJ: Wavefront 3D Object File.
  • GLTF/GLB: GL Transmission Format (recommended for web).

Note: STEP files (.stp, .step) are not directly supported in the browser. Please convert them to GLB or STL first.

You can also provide download links for your models or other files.

Download Example STLThe example STL file used in this guide.
Download Example OBJWavefront OBJ format.