Custom Cursor
By default, the editor uses the textarea’s native cursor. This is often sufficient, but the cursorPosition() extension and selectionChange events make it trivial to use a custom element to replace the cursor. This is what the customCursor() extension does.
All editors on this page have customCursor() added, so try it below:
Customizing the cursor
Section titled “Customizing the cursor”To customize the appearance of the cursor, use the --pce-cursor CSS variable to change the cursor’s color and the .pce-cursor selector to apply styles directly. Below are some examples of what can be changed using CSS.
Below you can toggle some of the styles shown above for all editors on this page:
Displaying document position
Section titled “Displaying document position”Other useful functionality in an editor is displaying the cursor’s line and column in the document. To make this easier, this library exports a getDocumentPosition() utility. The resulting document position is displayed below the following editor.
Ln 1, Col 10 selected