Days
Hours
Minutes
Seconds
x

New Froala Editor v5.0.0 is here โ€“ Learn More

Skip to content
Froala Documentation

Code View Plugin

Plugins are fully functional during your trial once you've added your trial key to the setup.

Enables view and edit of the HTML code behind the content.

Code view button is displayed by default under the More Misc menu


Plugin options:

codeViewKeepActiveButtons
Array - Default: ["fullscreen"]
A list of buttons to keep active while the editor is in Code View mode.

Plugin methods:

codeView.isActive ()
returns: Boolean
Find if code view mode is active.
codeView.get ()
returns: String
Get the HTML edited inside the code view mode.
codeView.toggle ()
returns: Object
Toggle between the code and text view.

Plugin events:

codeView.update ()
.
Triggered when the code view is changed

Add Plugin to your code:

Plugin name: codeView

Plugin JS Script: ../js/plugins/code_view.min.js

Or from CDN https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/code_view.min.js

Plugin CSS link: ../css/plugins/code_view.min.css


Plugin CSS link https://cdn.jsdelivr.net/npm/froala-editor@latest/css/plugins/code_view.min.css


Dependence :

For the plugin to work properly, You need to include the following CodeMirror 5 scripts and stylesheets in your web application before Froala script files

  <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/codemirror.min.j"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/mode/xml/xml.min.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.3.0/codemirror.min.css" />

Example:

Sign up

Download the code by signing up for our newsletter

Sign up

Download the code by signing up for our newsletter

Note: By registering, you confirm that you agree to the processing of your personal data by Froala, Inc. - Froala as described in the Privacy Statement. Froala, Inc. - Froala is part of the Idera group and may share your information with its parent company Idera, Inc., and its affiliates. For further details on how your data is used, stored, and shared, please review our Privacy Statement.