Reference for the artifact MDX component, including usage notes and examples.
Artifact embeds generated output references directly in spec documentation.
When to use
- Linking generated files to design decisions
- Showing expected output shape after model compilation
- Keeping docs and artifact paths aligned
Supported props
| Prop | Type | Required | Default | Purpose |
|---|---|---|---|---|
model_key | string | no | current route model | Model context for artifact lookup |
object_id | string | yes* | current route object | Object path that owns the artifact tab |
artifact_key | string | yes* | none | Artifact tab key to load |
atifact_key | string | no | alias of artifact_key | Backward-compatible typo alias |
type | 'erd' | 'openapi' | 'mdx' | yes* | none | Controls renderer and file target |
* In specs pages there is usually no model/object route context, so set object_id, artifact_key, and type explicitly.
Important
path and title are not supported props for Artifact. Use object_id
artifact_key+type.
Example
Source syntax
<Artifact
model_key="logic"
object_id="logic.iomodel.api"
artifact_key="openapi"
type="openapi"
/>Rendered output
If the artifact exists, the component renders:
type="openapi": interactive OpenAPI viewertype="erd": ERD paneltype="mdx": embedded MDX document
If required props are missing or artifact is not found, it shows an inline error placeholder.
Common pitfalls
- Using unsupported props (
path,title) - Passing
typeoutsideerd/openapi/mdx - Forgetting that
artifact_keyis required in non-model routes
Last updated on