sandpack-vue3

Vue3 components that give you the power of editable sandboxes that run in the browser.
254,838 111
Install
npm install sandpack-vue3
Latest Version:3.1.12
Vue:3
License:MIT
Last Updated:Dec 30, 2024
Links: GitHub  ·  npm
Maintainer: wc57242263
Component toolkit for live running code editing experiences

Sandpack Vue3

Vue3 components that give you the power of editable sandboxes that run in the browser.

import { Sandpack } from 'sandpack-vue3';

<Sandpack template="vue3" />;

Frome 3.0, we add some new templates:

Quickstart

node nextjs vite vite-react vite-react-ts vite-vue vite-vue-ts vite-svelte vite-svelte-ts vite-solid vite-lit astro

Read more

online demo

demo

ssg demo

Here's an example of a react version for comparison

https://stackblitz.com/edit/vitejs-vite-axyaxx

releases

https://github.com/jerrywu001/sandpack-vue3/releases

Sandpack Themes

A list of themes to customize your Sandpack components.

import { githubLight } from "@codesandbox/sandpack-themes";

<Sandpack theme={githubLight} />;

Read more

Documentation

For full documentation, visit https://sandpack.codesandbox.io/docs/

This project removes [devtools component && useSandpackLint hook]

SSG/SSR

Use vitepress/quasar

Register Components Globally

// main.ts
import SanpackPlugin from 'sandpack-vue3';

app.use(SanpackPlugin());
// tsconfig.json
{
  "compilerOptions": {
    "types": [
      "sandpack-vue3/global"
    ]
  }
}

registe components

Tips ☕

When using vue, please do not write it that way, It will not take effect

// 💀
<div style={{ height: 200 }}>

👉🏽Write it like this

<div style={{ height: '200px' }}>

install

npm i

npm run storybook

for nuxt3

  • nuxt.config.ts
import { defineNuxtConfig } from 'nuxt';

export default defineNuxtConfig({
  vite: {
    define: {
      'process.env.LOG': {},
    },
  },
});

Supported browsers

npx browserslist

Sponsor

Special Sponsor

special sponsor appwrite

Related Packages

vitepress-plugin-sandpack

use sandpack-vue3 in vitepress as directive.

194,903 57
markdown-to-jsx

A very fast and versatile markdown toolchain. AST, React, React Native, SolidJS,...

214,042,213 2,394
@scalar/use-toasts

display toasts in Vue

24,371,992 16,329
@scalar/use-codemirror

CodeMirror for Vue

21,770,238 16,329
@scalar/api-reference

Generate beautiful API references from OpenAPI documents

21,031,808 16,329

Version History

Version Released License
3.1.12 MIT
3.1.11 MIT
3.1.10 MIT
3.1.9 MIT
3.1.8 MIT
Pre-releases (2)
Version Released License
3.0.6-beta.1 MIT
3.0.6-beta.0 MIT