Days
Hours
Minutes
Seconds
x

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

Skip to content
Froala Documentation

Buttons

Custom Quick Insert Button

Try it yourself:


Quick Insert toolbar is one of the most popular editor's features. It appears when you have the cursor on a blank new line.

After defining a custom button you need to add it to the quick insert buttons list by using the quickInsertButtons option.

Edit in JSFiddle

HTML

<div id="froala-editor">
  <p>Hit enter at the end of this line to see the Quick Insert toolbar.</p>
</div>

JAVASCRIPT

<script>
  // Define an icon.
  FroalaEditor.DefineIcon('buttonIcon', { NAME: 'star', SVG_KEY: 'star'})

  // Define a button.
  FroalaEditor.RegisterQuickInsertButton('myButton', {
    // Icon name.
    icon: 'buttonIcon',

    // Tooltip.
    title: 'My Button',

    // Callback for the button.
    callback: function () {
      // Call any editor method here.
      this.html.insert('Hello Froala!');
    },

    // Save changes to undo stack.
    undo: true
  })

  new FroalaEditor('div#froala-editor', {
    quickInsertButtons: ['image', 'table', 'ol', 'ul', 'myButton'],
    pluginsEnabled: ['quickInsert', 'image', 'table', 'lists']
  })
</script>
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.