All Projects → vanillawc → wc-monaco-editor

vanillawc / wc-monaco-editor

Licence: MIT license
A vanilla Monaco Editor web component

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to wc-monaco-editor

Push State
Turn static web sites into dynamic web apps.
Stars: ✭ 16 (-82.8%)
Mutual labels:  vanilla, web-components
drawer
A touch-enabled drawer component for the modern web.
Stars: ✭ 26 (-72.04%)
Mutual labels:  vanilla, web-components
Vanilla Hamburger
Animated hamburger menu icons for modern web apps (1.8 KB) 🍔
Stars: ✭ 110 (+18.28%)
Mutual labels:  vanilla, web-components
Vanilla Colorful
A tiny color picker custom element for modern web apps (2.7 KB) 🎨
Stars: ✭ 467 (+402.15%)
Mutual labels:  vanilla, web-components
Vanillawc
Vanilla Web Components. A place for framework-free, transpiler-free, scaffolding-free web components.
Stars: ✭ 181 (+94.62%)
Mutual labels:  vanilla, web-components
fullcalendar-calendar
Web Component wrapper for FullCalendar
Stars: ✭ 21 (-77.42%)
Mutual labels:  web-components
lazy-cache
Cache requires to be lazy-loaded when needed. Uses node's own require system with tried and true, plain-vanilla JavaScript getters.
Stars: ✭ 51 (-45.16%)
Mutual labels:  vanilla
remote-input-element
An input element that sends its value to a server endpoint and renders the response body.
Stars: ✭ 72 (-22.58%)
Mutual labels:  web-components
Shadow-DOM-inject-styles
🎉 A helper function to easily modify Shadow DOM CSS.
Stars: ✭ 47 (-49.46%)
Mutual labels:  web-components
abdonrd.com
My little personal website
Stars: ✭ 16 (-82.8%)
Mutual labels:  web-components
modulor-html
Missing template engine for Web Components
Stars: ✭ 36 (-61.29%)
Mutual labels:  web-components
symbiote.js
Simple, light and very powerful library to create embedded components for any purpose, with a data flow management included.
Stars: ✭ 40 (-56.99%)
Mutual labels:  web-components
grid-container
A grid for the future, CSS Grid Layout + Web Components (Custom Elements v1 + Shadow DOM v1)
Stars: ✭ 51 (-45.16%)
Mutual labels:  web-components
wc-context
Context for Web Components
Stars: ✭ 26 (-72.04%)
Mutual labels:  web-components
esl
Lightweight and flexible UI component library based on web components technology for creating basic UX modules
Stars: ✭ 53 (-43.01%)
Mutual labels:  web-components
ElvUI
ElvUI for World of Warcraft - Vanilla (1.12.1)
Stars: ✭ 67 (-27.96%)
Mutual labels:  vanilla
w-components
JavaScript library based on Web Components.
Stars: ✭ 17 (-81.72%)
Mutual labels:  web-components
vaadin-board
Web Component for creating flexible responsive layouts and building nice looking dashboards.
Stars: ✭ 17 (-81.72%)
Mutual labels:  web-components
.github
Vanilla Web Components. A place for framework-free, transpiler-free, scaffolding-free web components.
Stars: ✭ 224 (+140.86%)
Mutual labels:  web-components
web-components-hooks-demo
web components hooks demo
Stars: ✭ 17 (-81.72%)
Mutual labels:  web-components

<wc-monaco-editor> Easily Embed a Monaco Editor

GitHub Releases NPM Releases Latest Status Release Status

Discord Published on WebComponents.org

Installation

Installation

npm i @vanillawc/wc-monaco-editor

Import from NPM

<script type="module" src="node_modules/@vanillawc/wc-monaco-editor/index.js"></script>

Import from CDN

<script type="module" src="https://cdn.jsdelivr.net/gh/vanillawc/wc-monaco-editor@1/index.js"></script>

Demo

Try it out here

Usage

Attributes

  • id - the editor id (default editor)
  • src - load the source from an external file
  • language - set the source language
  • font-size - set the font size (default 14px);
  • tab-size - set the tab size (in spaces) (default 2)
  • style - CSS styling (default height: 100%; width: 100%;)
  • no-minimap - disables the source minimap when present
  • word-wrap - enables word wrapping when present
  • wrap-indent - set the indent ['none','same','indent','deepindent'] for word wrapped lines (default none)

Note: The ID attribute is required if there are multiple editors

Properties

  • editor - the Monaco editor instance
  • src - get/set the src attribute from JS
  • value - get/set the editor's contents
  • tabSize - get/set the tab-index attribute from JS

Basic Usage

To edit plaintext

<wc-monaco-editor></wc-monaco-editor>

Language Support

Language support enables syntax highlighting, code completion, etc.

<wc-monaco-editor language="javascript"></wc-monaco-editor>

External Source

Load an external source file with the src attribute

<wc-monaco-editor src="sample.js" language="javascript"></wc-monaco-editor>

Advanced Configuration

A config can be provided for advanced use cases that require the full spectrum of Monaco Editor options.

<wc-monaco-editor config="config.json"></wc-monaco-editor>

config.json

{
  "language": "javascript",
  "minimap": {
    "enabled": false
  },
  "tabSize": 2,
  "fontSize": 16,
  "wordWrap": "on",
  "lineNumbersMinChars": 3,
  "wrappingIndent": "same",
  "mouseWheelZoom": true,
  "copyWithSyntaxHighlighting": false
}

Note: See the EditorOptions official documentation for all available options.

Contributing

See CONTRIBUTING.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].