package templates templ APIExplorer(explorer APIExplorerData) { if !explorer.IsLoggedIn { // Show mode toggle and mock data

Request Body (Example)

{ explorer.Endpoint.RequestBody }

Response (Mock)

{ explorer.Endpoint.Response }
@click="copyToClipboard(JSON.stringify({ explorer.Endpoint.RequestBody }, null, 2))" class="px-4 py-2 border border-border rounded bg-background-primary text-text-primary hover:bg-background-secondary cursor-pointer text-sm">Copy Request @click="copyToClipboard(JSON.stringify({ explorer.Endpoint.Response }, null, 2))" class="px-4 py-2 border border-border rounded bg-background-primary text-text-primary hover:bg-background-secondary cursor-pointer text-sm">Copy Response
} else { // Show interactive explorer with real execution

Request Body

} } // APIExplorerData holds data for the API explorer component type APIExplorerData struct { Endpoint EndpointInfo IsLoggedIn bool } // EndpointInfo holds information about an API endpoint type EndpointInfo struct { Method string Path string RequestBody string Response string Description string }