Let’s start by looking at some of the peculiarities of the Popup builder.
In Email and Page Builder, the content area width is saved in the template. For example, if you start with an empty template, a default width that works for most scenarios is chosen, but the designer can adjust the message width slider. If you start with an existing template, the content width was chosen by the template’s designer using the message width slider in the builder Settings tab.
With Popup Builder, the same template may have multiple contexts, and each context will likely have specific size requirements. For example, an exit-intent popup may have a max-width of 600px on a desktop with a classical layout centered on the screen. On the other hand, the host app may display the same template on mobile in the bar style docked at the bottom of the screen with a restricted width of 300px.
Since the content area’s width is tightly coupled to the context and layout, no one size fits all width is saved in the template. Instead, the host app will specify the width settings when the builder loads, based on the context of using the template. Here is a quick example:
Two final notes:
Popup Builder does not currently support fluid 100% width content.
If you don’t specify a width, the application will apply a default one.
As mentioned before, you will receive a ready-to-go design experience when no settings are provided. The default layout is a classic centered modal with a fixed width.
If the default popup style and layout suit your needs, then your customers are all set to start designing! You can load the builder without additional configuration and use the same standard controls and callbacks to access the HTML and JSON template.
What if you like most of the defaults but want to do some minor adjustments? We have you covered!
You can easily change the background to make the workspace look like the destination page where your customer will embed the popup.
If this option is not set, then we will provide a default skeleton layout. It’s worth noting at this point that you can apply every setting for both desktop and mobile design modes. That means you can have a different background when editing in Mobile Design Mode.
One of the most common needs is changing the popup’s default-centered position to better match the end-user’s use case. Out-of-the-box, the Popup Builder comes with many of the most common popup layouts preconfigured. You can use any available presets “as is” or use them as starting points that you can fine-tune to your satisfaction.
Here is a complete list of preset layouts:
What if the default styles and standard settings aren’t enough? No worries! In the following sections, we will look at styling your popup to make it look and feel more like the one real visitors will interact with.
A theme is simply a set of custom styles that give the popup its look and feel. Separate from your layout, Popup Builder comes with some preset themes. The primary is our default theme that is loaded when no settings are specified. We also provide an empty theme that has no styles, which you can use a blank canvas to create your own theme. This is one of the most powerful features of Popup Builder, and we’ll be covering custom styles in depth below.
Here is a preview of the configuration:
To understand the best way to apply your styles, let’s start by inspecting the underlying HTML structure so you can view where the system will map your styles.
Here is a quick break down of what each div does:
This is where you will apply any styles related to how the popup looks, such as border-radius, drop shadows, background colors, or padding.
The header is sometimes used to add a close icon to a popup or display a title.
The div that holds the editable content of your Beefree application.
You can use this div to show a traditional footer for your popup or position some icons outside the popup container (e.g., a close button).
The above HTML structure is represented in your bee config as the following JSON object.
Add styles to the JSON section that corresponds to the HTML element you want to style.
For example, if you want to apply styles to the div with id popup-container, then you would add the styles to the following JSON:
We’ll go deeper into styling in the following sections.
You may be wondering at this point if you have to design an entire theme to get started. Well, you can if you want to, but thanks to the order of operations, you don’t have to. You can start with our default theme and pass in the styles that you want to override. Any style you provide will take priority over any of the defaults.
We said that you could start from scratch if you want, and the easiest way to do that is by using our theme parameter. This allows you to avoid overriding every default style and gives you an empty canvas to build your own theme.
Now that you have seen what the HTML looks like and have some idea where to apply your styles, let’s look at how you get your styles into the editor. The best way to show you is by example, so let’s get started with some common use cases!
Using the schema JSON above and your HTML structure knowledge, you probably guessed that the border is defined on the popup container. So here’s what that would look like:
Example:
After looking at a couple of samples, you may notice these parameters are looking familiar. That’s because every layer of our schema maps to a layer of HTML with the same name AND can be styled with any valid CSS property.
Basically, CSS properties are the same as CSS used by web developers in style sheets, but instead of dashes to separate words, it uses a camel case.
Example:
The CSS property of the style box-shadow would be boxShadow.
Why not use CSS styles as defined by CSS3 specification directly? Well, simply put, CSS properties are better suited for JSON and can easily be shared with any FE application using the popular React framework.
We covered the default layout settings in Setting layout and size section. To recap, the layout determines the type of popup (e.g., a bar) and its location on the screen (e.g., bottom, top, or side). Our research team looked into it, and it turns out, nearly all popups fall into one of the most popular layouts, which we’ve included as presets. But, when that’s not enough, the configuration option customLayout can be used to make minor adjustments to a preset layout or create an entirely new layout from scratch.
Here is a preview of the configuration:
The popup is positioned in the workspace using divs and CSS flexbox. We created a layout structure that mimics an HTML page to map your page’s styles to the workspace.
Layout HTML:
Here is a quick break down of what each div does:
We will apply the styles placed here to the document HTML tag.
We will apply the styles placed here to the HTML body tag
This is the main container div of the workspace.
The wrapper of the popup is used entirely for positioning the popup within the workspace main div.
Example:
Name | Value | Description |
---|---|---|
Classic Popup
classic-center
classic-top-right
classic-top-left
classic-bottom-right
classic-bottom-left
This is our default layout and works great for alerts and exit intents.
Drawer or Slide-in panel
drawer-left
drawer-right
Side panels, or drawers, can be used to design menus or display ads.
Bar or Docker
bar-bottom
bar-top
This is great for cookie approval dialogs.