cm-resize-limited
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

cm-resize-limited

Add a resize handle to your CodeMirror editor. Forked from Sphinxxxx/cm-resize, with some small improvements.

Getting Started

Installing

  • NPM:

    • npm install cm-resize-limited --save
    • import cmResize from 'cm-resize-limited';

Usage

const myCodeMirror = CodeMirror.fromTextArea(element, options);  //..or some other way to create a CodeMirror instance
cmResize(myCodeMirror);

Options

const handle = cmResize(myCodeMirror, {
    minWidth:  200,               // Minimum size of the CodeMirror editor.
    minHeight: 100,
    
    maxWidth:  400,               // Maximum size of the CodeMirror editor.
    maxHeight: 800,
 
    resizableWidth:  true,        // In which direction the editor can be resized (default: both width and height).
    resizableHeight: true,
 
    cssClass: 'cm-resize-handle', // CSS class to use on the *default* resize handle.
    handle: someElement,          // An element to use as the handler instead of the default one (`cssClass` doesn't apply here).
});

Readme

Keywords

none

Package Sidebar

Install

npm i cm-resize-limited

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

17.7 kB

Total Files

6

Last publish

Collaborators

  • cerberuser