Skip to content

Custom Slots

The OAOperation component provides several slots for customizing the operation layout. These slots allow you to override the default components with your own custom content.

Available Slots

The following slots are available for customization:

  • header
  • tags
  • path
  • description
  • security
  • parameters
  • request-body
  • responses
  • playground
  • code-samples
  • branding
  • footer

In the following example, we demonstrate how to use all available slots in the OAOperation component. Each slot is populated with a SlotDebugger component that displays the slot properties for debugging purposes.

markdown
---
aside: false
outline: false
title: vitepress-openapi
---

<OAOperation operationId="createArtist">

<template #header="header">
<SlotDebugger :slotProps="header" title="header" />
</template>

<template #tags="tags">
<SlotDebugger :slotProps="tags" title="tags" />
</template>

<template #path="path">
<SlotDebugger :slotProps="path" title="path" />
</template>

<template #description="description">
<SlotDebugger :slotProps="description" title="description" />
</template>

<template #security="security">
<SlotDebugger :slotProps="security" title="security" />
</template>

<template #parameters="parameters">
<SlotDebugger :slotProps="parameters" title="parameters" />
</template>

<template #request-body="requestBody">
<SlotDebugger :slotProps="requestBody" title="request-body" />
</template>

<template #responses="responses">
<SlotDebugger :slotProps="responses" title="responses" />
</template>

<template #playground="playground">
<SlotDebugger :slotProps="playground" title="playground" />
</template>

<template #code-samples="codeSamples">
<SlotDebugger :slotProps="codeSamples" title="code-samples" />
</template>

<template #branding="branding">
<SlotDebugger :slotProps="branding" title="branding" />
</template>

<template #footer="footer">
<SlotDebugger :slotProps="footer" title="footer" />
</template>

</OAOperation>

header slot

Slot Props
PropertyTypeValue
keynumber0
operationobject
{...}
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
pathstring/api/v1/artists
deprecatedundefinedundefined

path slot

Slot Props
PropertyTypeValue
operationIdstringcreateArtist
operationobject
{...}
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
pathstring/api/v1/artists
hideBaseUrlbooleantrue
deprecatedundefinedundefined
serversobject
[...]
updateSelectedServerfunctionfunction k(G) { y.value = G; }

description slot

Slot Props
PropertyTypeValue
keynumber1
operationobject
{...}
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
pathstring/api/v1/artists

security slot

Slot Props
PropertyTypeValue
keynumber0
operationobject
{...}
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
pathstring/api/v1/artists
securityUiobject
[...]

request-body slot

Slot Props
PropertyTypeValue
keynumber0
operationIdstringcreateArtist
requestBodyobject
{...}

responses slot

Slot Props
PropertyTypeValue
keynumber0
operationIdstringcreateArtist
responsesobject
{...}

playground slot

Slot Props
PropertyTypeValue
operationIdstringcreateArtist
pathstring/api/v1/artists
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
parametersundefinedundefined
requestBodyobject
{...}
securityUiobject
[...]
requestobject
{...}
updateRequestfunctionfunction w(G) { x.value = G; }
serversobject
[...]
updateSelectedServerfunctionfunction k(G) { y.value = G; }

code-samples slot

Slot Props
PropertyTypeValue
operationIdstringcreateArtist
operationobject
{...}
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
pathstring/api/v1/artists
requestobject
{...}
updateRequestfunctionfunction w(G) { x.value = G; }
codeSamplesundefinedundefined

branding slot

Slot Props
PropertyTypeValue
keynumber2
operationIdstringcreateArtist
operationobject
{...}
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
pathstring/api/v1/artists

footer slot

Slot Props
PropertyTypeValue
keynumber3
operationIdstringcreateArtist
operationobject
{...}
methodstringPOST
baseUrlstringhttps://stoplight.io/mocks/enzonotario/argentine-rock/122547792
pathstring/api/v1/artists