# CodeMirror

CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addons that implement more advanced editing functionality.

https://codemirror.net (opens new window)

CodeMirror

# Component

A Laravel Blade Component is available for CodeMirror, see the component documentation

# Loading

To use CodeMirror on your page you can use the loading view boilerplate::load.codemirror (opens new window)

@include('boilerplate::load.codemirror')

# Theme

You can add a theme by putting a CSS file in the folder /assets/vendor/boilerplate/js/codemirror/theme

Default theme is storm.

# Usage

@include('boilerplate::load.codemirror')
@push('js')
    <script>
        var myCode = $('#code').codemirror();
        // To get the value : myCode.getValue();
    </script>
@endpush