You can create plugins to customize Builder and the Visual Editor to meet your team's needs. This document covers the areas you can customize with Builder.register(<some-key>)
:
appTab
:the left sidebar of the Builder UIeditor.mainTab
: top bar of the Visual Editoreditor.editTab
: the panel of the UI that contains the Insert, Options, Style, Layers, Animate, and Data tabs.editor.insertMenu
: the Insert tabeditor.toolbarButton
: the topmost section of the Visual Editor that displays features such as the icons for targeting, scheduling, alerts, code, preview, and the Publish button.
The table in the next section provides a screenshot of which part of Builder each of these keys refer to and example of how you might customize it.
Location | Example |
---|---|
| Make an app-wide tab that displays and edits content in unique ways using our read and write APIs. For example, make a content calendar so you can view your scheduled content on a calendar that shows when content will go live when, and give the user the ability to drag to reschedule.
|
| Add a new tab located at the top of the preview window to view or edit the current document. For example, create a notes tab so people can post and view notes to collaborate.
|
| Add a new tab located on the left sidebar to edit the currently selected element(s). For example, create a Tailwind UI tab that applies Tailwind classes to elements.
|
| Override the Insert menu and display custom components.
|
| Add a toolbar button. For example, create a workflow status button for custom workflows.
|
Tip: For an example plugin with multiple options, refer to Builder's campaign plugin example.
Use the following toggles to further customize the Visual Editor:
import { Builder } from '@builder.io/sdk'
Builder.register('editor.settings', {
hideStyleTab: false, // Hide the Style tab
hideMainTabs: false, // Hide all main tabs
hideDataTab: false , // Hide the Data tab
hideOptionsTab: false, // Hide the Options tab
hideToolbar: false, // Hide the main toolbar
hideHeatMap: false, // Hide the Heatmap button
hidePageUrlEditor: false, // Hide the Page URL editor
hideAnimateTab: false, // Hide the Animate tab
hideInsertTab: false, // Hide the Insert tab
hideTargeting: false, // Hide the Targeting UI
hideHelpWidget: false, // Hide help widget
disableTargetingFields: [], // Array of targeting fields to disable
// disableTargetingFields can be any targeting, like
// ['url', 'urlPath', 'device', 'yourCustomTargetingField']
disableOverflowButtons: [], // Disables buttons in the overflow menu next to Publish
// disableOverflowButtons can be one of
// ['archive', 'duplicate', 'move', 'copy', 'globalSymbol', 'share', 'exportToPdf', 'getCode', 'fiddle', 'delete']
})
Builder's open source examples uses this pattern, demonstrate a pattern that provides access to application state, including the current editing document and API access.
Visit builder/packages/app-context/index.d.ts
on GitHub for more information and type definitions that are available in app state.