Days
Hours
Minutes
Seconds
x

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

Skip to content
Froala Documentation

Custom Elements

Custom Quick Insert Button

Below is the basic JS for creating a custom button for the editor.

For a working example please see the Custom Quick Insert Button Example.

// Define an icon.
FroalaEditor.DefineIcon('buttonIcon', { NAME: '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
})

Note: Once a button is defined it can be included in the quickInsertButtons option.

Do you think we can improve this article? Let us know.

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.