npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-api-playground

v2.6.0

Published

Interactive API playground component for Vue 3. Plug-and-play with VitePress or any Vue 3 app — automatically inherits host theme styles.

Downloads

482

Readme

Vue API Playground

npm version CI License: MIT

Interactive API playground component for Vue 3. Plug-and-play with VitePress or any Vue 3 app — automatically inherits host theme styles.

Successor to vuepress-api-playground.

Features

  • Plug & play theming — CSS custom properties cascade from VitePress or your own theme
  • All HTTP methods — GET, POST, PUT, PATCH, DELETE with URL path parameters
  • Response time & headers — performance metrics and collapsible response headers
  • Copy response — one-click copy to clipboard
  • TypeScript — fully typed props and exports
  • Lightweight — zero runtime dependencies, ~3 KB gzipped

Install

npm install vue-api-playground

Quick Start

VitePress

// docs/.vitepress/theme/index.ts
import DefaultTheme from 'vitepress/theme'
import { Playground } from 'vue-api-playground'
import 'vue-api-playground/styles'

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    app.component('VueApiPlayground', Playground)
  },
}

Then in any .md file:

<VueApiPlayground
  url="https://jsonplaceholder.typicode.com/posts/{id}"
  method="get"
  :data="[{ name: 'id', value: '1', type: 'number' }]"
/>

Vue 3 App

import { createApp } from 'vue'
import { Playground } from 'vue-api-playground'
import 'vue-api-playground/styles'

// Register globally
app.component('VueApiPlayground', Playground)

// Or import directly in a component
<script setup>
import { Playground } from 'vue-api-playground'
</script>

<template>
  <Playground
    url="https://jsonplaceholder.typicode.com/posts/{id}"
    method="get"
    :data="[{ name: 'id', value: '1', type: 'number' }]"
  />
</template>

Props

| Prop | Type | Default | Description | | ---------------- | ------------------------ | ------------------ | ----------------------------------------------------------------------- | | url | string | — | API endpoint. Supports {param} and <param> path parameters | | method | string | — | HTTP method: get, post, put, patch, delete | | data | PlaygroundDataItem[] | [] | Input fields for the request | | headers | Record<string, string> | — | Custom HTTP headers (editable) | | showMethod | boolean | false | Show method badge | | showUrl | boolean | false | Show URL | | headingTag | string | 'h4' | HTML tag for section headings | | servers | string[] | — | Server URLs. When more than one, a selector is rendered | | contentType | PlaygroundContentType | — | Body serialization: json, urlencoded, multipart, text/plain, xml | | body | string | — | Preset request body (JSON/text/XML). User edits take precedence | | v-model:auth | AuthConfig | {type:'none'} | Declarative auth: none, bearer, basic, or apiKey (header/query) | | v-model:server | string | first of servers | Currently selected base URL |

Events

| Event | Payload | Description | | ----------------- | --------------------------------------- | ------------------------------ | | before-send | { url, init } | Mutate envelope before fetch | | request-start | { url, method, headers, body } | Fires just before fetch() | | request-success | { status, headers, body, durationMs } | Fires on successful response | | request-error | { error, durationMs } | Fires on network / abort error |

Custom Theming

Override --vap-* CSS variables to match your design:

:root {
  --vap-brand: #6366f1;
  --vap-text: #1a1a1a;
  --vap-border: #e5e7eb;
  --vap-radius: 8px;
}

For dark mode, override under your dark class:

.dark {
  --vap-text: #e5e7eb;
  --vap-bg: #1a1a2e;
  --vap-border: #334155;
  --vap-code-bg: #0f172a;
}

When no --vap-* variables are set, the component falls back to VitePress theme variables, then hardcoded defaults. See the full variable reference for all 14 customizable properties.

You can also skip the default styles entirely and write your own — the component renders semantic HTML with vap- prefixed classes.

Documentation

Full documentation with live examples: rodindev.github.io/vue-api-playground

Contributing

See CONTRIBUTING.md.

License

MIT