Artifact Component
Artifact Component

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

PropTypeRequiredDefaultPurpose
model_keystringnocurrent route modelModel context for artifact lookup
object_idstringyes*current route objectObject path that owns the artifact tab
artifact_keystringyes*noneArtifact tab key to load
atifact_keystringnoalias of artifact_keyBackward-compatible typo alias
type'erd' | 'openapi' | 'mdx'yes*noneControls 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 viewer
  • type="erd": ERD panel
  • type="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 type outside erd/openapi/mdx
  • Forgetting that artifact_key is required in non-model routes

Last updated on