@ahmttyydn/use-codemirror

CodeMirror for Vue
1,612
Install
npm install @ahmttyydn/use-codemirror
Latest Version:1.0.9
Vue:3
License:MIT
Last Updated:May 16, 2026
Links: GitHub  ·  npm
Maintainer: ahmttyydn

CodeMirror Hook for Vue

Version Downloads License Discord

Installation

npm install @ahmttyydn/use-codemirror

Usage

<script setup>
import { useCodeMirror } from '@ahmttyydn/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

@scalar/use-codemirror

CodeMirror for Vue

21,770,238 16,329
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

Version History

Version Released Vue License
1.0.9 ^3.5.30 MIT
1.0.8 ^3.5.30 MIT
1.0.6 ^3.5.30 MIT
1.0.4 ^3.5.30 MIT
1.0.2 ^3.5.30 MIT