Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mtmeyer/codemirror-svelte-modules

Svelte wrapper for Codemirror 6
https://github.com/mtmeyer/codemirror-svelte-modules

Last synced: 6 days ago
JSON representation

Svelte wrapper for Codemirror 6

Awesome Lists containing this project

README

        

# CodeMirror Svelte Modules

This is a simple wrapper around Codemirror using their new architecture in v6.

This library was heavily inspired by a similar React library [`@uiw/react-codemirror`](https://uiwjs.github.io/react-codemirror/)

## CodeMirror Documentation

In version 6 CodeMirror only exports modules as described here: [CodeMirror v6 Guide](https://codemirror.net/6/docs/guide/)

For all the v6 documentation go here: [CodeMirror v6 Documentation](https://codemirror.net/6/docs/)

## Example

```html

import CodeMirror from 'codemirror-svelte-modules';

```

### Props

More details on props and their types coming soon

- extensions: `Extensions[]`
- height: `string`
- minHeight: `string`
- maxHeight: `string`
- width: `string`
- minWidth: `string`
- maxWidth: `string`
- editable: `boolean`
- readOnly: `boolean`
- autoFocus: `boolean`
- theme: `Extension`
- basicSetup: `boolean`
- initialValue: `string`

### Adding extensions

```html

import CodeMirror from 'codemirror-svelte-modules';
import { syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language';
import { javascript } from '@codemirror/lang-javascript';

```