@scalar/use-codemirror

CodeMirror for Vue
8,135,775 16,327
Install
npm install @scalar/use-codemirror
Latest Version:0.14.16
Vue:3
License:MIT
Last Updated:Oct 27, 2026
Links: GitHub  ·  npm
Maintainer: cameronrohani

CodeMirror Hook for Vue

Version Downloads License Discord


Scalar is an open-source API platform for teams who want beautiful developer interfaces without vendor lock-in.

  • API References — Interactive API documentation from OpenAPI and AsyncAPI specs.
  • Developer Docs — Write in Markdown/MDX, generate API references, sync with two-way Git.
  • SDK Generator — Type-safe SDKs and CLIs in TypeScript, Python, Go, PHP, Java, and Ruby.
  • API Client — Open-source, offline-first Postman alternative built on OpenAPI.

20M+ monthly npm installs · 15,500+ GitHub stars · MIT licensed · scalar.com


Installation

npm install @scalar/use-codemirror

Usage

<script setup>
import { useCodeMirror } from '@scalar/use-codemirror'
import { ref } from 'vue'

const editor = ref(null)

const { codeMirror, setCodeMirrorContent } = useCodeMirror({
  codeMirrorRef: editor,
  content: '{ "foo": "bar" }',
  language: 'json',
  lineNumbers: true,
  onChange: (value) => {
    console.log('Content changed:', value)
  },
})
</script>

<template>
  <div ref="editor" />
</template>

Community

We are API nerds. You too? Let's chat on Discord: https://discord.gg/scalar

License

The source code in this repository is licensed under MIT.

Related Packages

vueuse-temporals

Date related composables for atmosphere-ui

1,676 1
codemirror-mode-elixir

A CodeMirror mode for the Elixir language

206,625 24
nuxt-codemirror

Nuxt codemirror module

27,616 24
@alvarosabu/ui

UI Library for my personal projects

14,634 5
@orbisk/vue-use-media-recorder

🪝 Vue Composable around MediaRecorder API

12,546 2

Version History

Version Released Vue License
0.14.16 ^3.5.44 MIT
0.14.15 ^3.5.40 MIT
0.14.14 ^3.5.30 MIT
0.14.13 ^3.5.30 MIT
0.14.12 ^3.5.30 MIT