Skip to main content

How to create Custom Tabs in React

How to create Custom Tabs in React

Khizar Tanveer avatar
Written by Khizar Tanveer
Updated over 3 months ago

To use Custom Tabs in a React environment, you’ll need to bundle your custom code before passing it to the editor. Follow these steps:

  1. Create a new file and add the custom tab code you want to use.

  2. Bundle the file using Webpack (or any preferred bundler). This step is required because the customJS property expects a standalone, browser-ready JavaScript file.

  3. Host the bundled file on a server or CDN so it can be accessed via a public URL.

  4. Provide the hosted file URL to the customJS property in your unlayer.init() configuration.

Note: Bundling is essential when working in React because the code needs to be transformed into a format the editor can load directly in the browser.

Did this answer your question?