Create custom notifications

TinyMCE can display customized notifications.

Interactive example

  • TinyMCE

  • HTML

  • JS

  • Edit on CodePen

<textarea id="notifications">
  <p><img style="display: block; margin-left: auto; margin-right: auto;" title="Tiny Logo" src="" alt="TinyMCE Logo" width="128" height="128"></p>
  <h2 style="text-align: center;">Welcome to the TinyMCE editor demo!</h2>

  <h2>Got questions or need help?</h2>

    <li>Our <a href="">documentation</a> is a great resource for learning how to configure TinyMCE.</li>
    <li>Have a specific question? Try the <a href="" target="_blank" rel="noopener"><code>tinymce</code> tag at Stack Overflow</a>.</li>
    <li>We also offer enterprise grade support as part of <a href="">TinyMCE premium plans</a>.</li>

  <h2>A simple table to play with</h2>

  <table style="border-collapse: collapse; width: 100%;" border="1">

  <h2>Found a bug?</h2>

    If you think you have found a bug please create an issue on the <a href="">GitHub repo</a> to report it to the developers.

  <h2>Finally ...</h2>

    Thanks for supporting TinyMCE! We hope it helps you and your users create great content.<br>All the best from the TinyMCE team.
const createSuccessNotification = () => {{
    text: 'This is an success notification.<br/>TinyMCE loaded Successfully!',
    type: 'success'

const createInformationNotification = () => {{
    text: 'This is an informational notification.',
    type: 'info'

const createWarningNotification = () => {{
    text: 'This is a warning notification.',
    type: 'warning'

const createErrorNotification = () => {{
    text: 'This is an error... notification.',
    type: 'error'

  selector: 'textarea#notifications',
  height: 500,
  menubar: false,
  plugins: 'lists link image fullscreen table help',
  toolbar: 'undo redo | blocks | ' +
  'bold italic backcolor | alignleft aligncenter ' +
  'alignright alignjustify | bullist numlist outdent indent | ' +
  'removeformat | help',
  setup: (editor) => {
    editor.on('SkinLoaded', (e) => {
  content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'


The text property sets the text that is displayed at the center of the notification. This is the most important setting when opening a notification.{
  text: 'A test informational notification.'


The following notification types differ in color and purpose:

  • success

  • info

  • warning

  • error

Set the type property when opening the notification. The default style is used if this property is not set.{
  text: 'A test informational notification.',
  type: 'info'


The notification automatically closes after the value set in the timeout property elapses in milliseconds.{
  text: 'A test notification that will close automatically after 5 seconds.',
  timeout: 5000

Close Button

Disable the close button to the right of the notification by setting the closeButton property to false. It is recommended to use this in conjunction with a timeout property that is not zero, however it can be used without including a timeout.{
  text: 'A test notification that will close automatically after 5 seconds and has the close button disabled.',
  timeout: 5000,
  closeButton: false


Set the icon property to display an icon to the left of the text.{
  text: 'A test notification that contains a bold icon.',
  icon: 'bold'

For a list of the icon identifiers, see: Available icons.

Progress Bar

Set the progressBar property type to True to display a progress bar to the left of the close button and to the right of the text.

const notification ={
  text: 'A test notification that contains a progress bar.',
  progressBar: true

Set the progressBar property between 0 and 100 to set the progress of the progress bar.


To close the last shown notification, call the following method:

// Close the last shown notification.