Styling a popup
You have full style control over how the popup looks. The popup container is a div. You can assign your own class name to it with the className property or the setClassName method.
The popup container div will have the following default styles:
backgroundColor: #fffcolor: #333padding: 3px 6pxborderRadius: 4pxboxShadow: 0 0 5px rgba(0,0,0,0.3)transform: translate(-50%, -100%)
If the center option is set to false then transform: translate(0, -100%) so that the popup is above the element. If you don't want that then you can override the transform style.
The other default styles can be removed by setting the theme option to none.
You can also override individual default styles with the styles property or the style() method.
There are four ways to style the popup:
- Do nothing and the above default styles are set.
- Create a
divtag that you set as the content for the popup. Thatdivtag can either have a CSS class that you attach styles to, or you can assign styles to thedivDOM element when you are creating it. You will probably want to also set thethemetononeto remove the default styles. Note that the popup content is set inside the popup containerdivthat by default has the above styles applied to it. - Pass an object of styles to the
stylesto style the containerdivtag that wraps the popup content. These styles will overwrite the default styles above if you pass the same style name. For example, if you includecolorin yourstylesobject then that will overwrite the default color above. You can also set thethemetononeto completely remove the default styles. - Add a class name to the container
divthat wraps the popup content with theclassNameoption and then attach styles to that CSS class name.