You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-10Lines changed: 28 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -27,37 +27,55 @@ You can also use the standalone build by including `dist/react-codemirror.js` in
27
27
npm install react-codemirror --save
28
28
```
29
29
30
-
Ensure that ``codemirror.css`` is loaded. It can be included in your module css as shown in [example.less](example/src/example.less) or linked explicitly in your index.html file e.g ``<link href="css/codemirror.css" rel="stylesheet">``.
31
-
32
30
33
31
## Usage
34
32
33
+
Require the CodeMirror component and render it with JSX:
Ensure that CodeMirror's stylesheet `codemirror.css` is loaded.
64
+
65
+
If you're using LESS (similar for Sass) you can import the css directly from the codemirror package, as shown in [example.less](example/src/example.less):
If you're using Webpack with the css loader, you can require the codemirror css in your application instead:
72
+
73
+
```js
74
+
require('codemirror/lib/codemirror.css');
75
+
```
76
+
77
+
Alternatively, you can explicitly link the `codemirror.css` file from the CodeMirror project in your index.html file, e.g `<link href="css/codemirror.css" rel="stylesheet">`.
78
+
61
79
### Methods
62
80
63
81
*`focus` focuses the CodeMirror instance
@@ -88,13 +106,13 @@ By default (to optimise bundle size) all modes are not included. To enable synta
0 commit comments