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" />Examples
Section titled “Examples”STL File
Section titled “STL File”OBJ File
Section titled “OBJ File”GLB File
Section titled “GLB File”Supported Formats
Section titled “Supported Formats”- 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.
Downloads
Section titled “Downloads”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.