Description
code-input.js is a JavaScript library that turns a plain textarea into an editor with syntax highlighting. It works with any highlighting algorithm, such as Prism.js, so it can be used for code or for any other text that needs colour. The component supports HTML forms and the standard textarea JavaScript interface, so existing form code keeps working. It is built to be lightweight, modular, accessible and progressively enhanced, and it ships with plugins and demos and tutorials showing setup with Prism.js. The static syntax highlighter is separate from the editing component, so you can use either on its own. The current release is v2.9.0, and the v1 line is still available. The library is free, libre and open source under the MIT license. You can get it from GitHub or Codeberg as a ZIP or tarball, or from npm and Yarn as @webcoder49/code-input.…
Highlights
- Editable textarea with any syntax highlighter
- Works with HTML forms and the textarea API
- Plugins and Prism.js demos
- Static highlighter that can be used on its own
- MIT license, on npm, GitHub and Codeberg
Ratings & Reviews
No ratings yet
Be the first to rate Code Input.
People also visit
Prism code editor
Lightweight, extensible code editor component for the web using Prism
Code Input FAQ
What is code-input.js?
A JavaScript component that makes an editable textarea with syntax highlighting, for code or any other text.
How do I install it?
Install @webcoder49/code-input from npm or Yarn, or download the ZIP or tarball from GitHub or Codeberg. The site has a Prism.js demo to start from.
What license is it under?
The MIT license, also called the Expat license. It is free, libre and open source software.
Does it work with forms?
Yes. It supports HTML forms and the textarea JavaScript interface.
Can I use any highlighter?
Yes. The site says it supports any syntax highlighting algorithm, and it shows a Prism.js demo.
What are the best Code Input alternatives?
Popular alternatives to Code Input include React Textarea Code Editor, Yace and Codejar. See all Code Input alternatives
