Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div>
  <h2>Basic Usage</h2>
  <pre>
    <code class="js">
      var hive = new SupportBeeHive({ company: 'muziboodemo' });
      hive.init({ widget: 'contact', forwarding_address_id: 314 });
    </code>
  </pre>
  <p>The <code>SupportBeeHive</code> constructor requires a <code>company</code> parameter. So far that's the only parameter the constructor expects.<p>
  <br>
  <h2>Configuration</h2>
  <p>These are all the available options for the <code>init</code> method:</p>
  <table width="1080px">
    <thead>
      <th>
        <tr>
          <td width="200px">Name</td>
          <td with="300px">Default</td>
          <td>Available options, description</td>
        </tr>
      </th>
    </thead>
    <tbody>
      <tr>
        <td width="200px">widget</td>
        <td width="200px"><code>null</code></td>
        <td><code>"kb"</code> or <code>"contact"</code></td>
      </tr>
      <tr>
        <td>theme</td>
        <td><code>"rgb(123, 22, 255)"</code></td>
        <td>Any string that represents a valid CSS color. It can be represented in rgb, hex, hsl, etc. It is used for creating the background color of the launcher and the submit button if the widget type is "contact".</td>
      </tr>
      <tr>
        <td>locale</td>
        <td><code>"en"</code></td>
        <td><code>"de"</code>, <code>"en"</code>, <code>"es"</code>, <code>"fr"</code>, <code>"pt-BR"</code>, <code>"nl"</code>, <code>"pl"</code>, <code>"ru"</code>, <code>"sv-SE"</code> or <code>"vi"</code>.</td>
      </tr>
      <tr>
        <td>launcher.hint</td>
        <td><code>null</code></td>
        <td>Optional content used for a button positioned at the side of the main launcher.</td>
      </tr>
      <tr>
        <td>launcher.icon</td>
        <td><code>null</code></td>
        <td>String representing an SVG element. Watch out the size of the SVG element, has to be tuned to fit into the button, otherwise might not be displayed properly. A height and width between 22px and 30px is recommended.</td>
      </tr>
      <tr>
        <td width="200px">launcher.position</td>
        <td width="200px"><code>"right-bottom"</code></td>
        <td><code>"top-left"</code>, <code>"left-top"</code>, <code>"top-right"</code>, <code>"right-top"</code>, <code>"right-bottom"</code>, <code>"bottom-right"</code>, <code>"left-bottom"</code> or <code>"bottom-left"</code></td>
      </tr>
      <tr>
        <td>launcher.openEl</td>
        <td><code>null</code></td>
        <td>Custom HTML element to toggle the widget.</td>
      </tr>
      <tr>
        <td>launcher.hidden</td>
        <td><code>false</code></td>
        <td>Hide the open button and the hint of the widget. Useful to open the widget from a custom HTML element. The close icon will still be displayed.</td>
      </tr>
      <tr>
        <td>forwarding_address_id</td>
        <td><code>null</code></td>
        <td>Number or string, effective <b>only if the widget option is <code>"contact"</code>.</b></td>
      </tr>
      <tr>
        <td>requireCaptcha</td>
        <td><code>false</code></td>
        <td>Boolean value to set either the , effective <b>only if the widget option is <code>"contact"</code>.</b></td>
      </tr>
      <tr>
        <td>site</td>
        <td><code>null</code></td>
        <td>Name of the SB KB site, effective <b>only if the widget option is <code>"kb"</code>.</b></td>
      </tr>
      <tr>
        <td>forwarding_address_id</td>
        <td><code>null</code></td>
        <td>Number or string, effective <b>only if the widget option is <code>"contact"</code>.</b></td>
      </tr>
      <tr>
        <td>requireCaptcha</td>
        <td><code>false</code></td>
        <td>Boolean value to enable or disable the captach in the contact form, therefore it is effective <b>only if the widget option is <code>"contact"</code>.</b></td>
      </tr>
      <tr>
        <td>defaults</td>
        <td><code>{ requester_name: '', requester_email: '', subject: '', message: '' }</code></td>
        <td>Default values for the contact form, therefore it is effective <b>only if the widget option is <code>"contact"</code>.</b></td>
      </tr>
    </tbody>
  </table>
</div>

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/tomorrow-night.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
              
            
!

CSS

              
                body,
html {
  font-size: 15px;
}

p,
table,
h1,
h2 {
  font-family: Arial;
  margin-bottom: 1rem;
}

table thead {
  font-weight: bold;
}

table tr td {
  border-bottom: 1px solid #EEE;
  padding: 0.5rem;
}

div {
  padding: 2rem;
}
              
            
!

JS

              
                
(function(p,src) {
  var script = p.createElement('script');
  script.src = src;
  script.async = true;
  script.onload = function() {
    new SupportBeeHive({ company: 'muziboodemo' }).init({
      widget: 'contact',
      locale: 'de',
      forwarding_address_id: 38,
      defaults: {
        requester_name: 'Default customer name',
      },
      launcher:{
        hint: 'Contact us',
        icon: '<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 300 300" width="32px" height="32px"><g><g><path d="M149.996,0C67.157,0,0.001,67.161,0.001,149.997S67.157,300,149.996,300s150.003-67.163,150.003-150.003    S232.835,0,149.996,0z M221.302,107.945l-14.247,14.247l-29.001-28.999l-11.002,11.002l29.001,29.001l-71.132,71.126    l-28.999-28.996L84.92,186.328l28.999,28.999l-7.088,7.088l-0.135-0.135c-0.786,1.294-2.064,2.238-3.582,2.575l-27.043,6.03    c-0.405,0.091-0.817,0.135-1.224,0.135c-1.476,0-2.91-0.581-3.973-1.647c-1.364-1.359-1.932-3.322-1.512-5.203l6.027-27.035    c0.34-1.517,1.286-2.798,2.578-3.582l-0.137-0.137L192.3,78.941c1.678-1.675,4.404-1.675,6.082,0.005l22.922,22.917    C222.982,103.541,222.982,106.267,221.302,107.945z" fill="white"/></g></g></svg>', 
      },
      theme: 'blue',
    });
  };
  p.head.appendChild(script);
})(document, 'https://d3932137p5ikt7.cloudfront.net/widget_v4/hive.js');

              
            
!
999px

Console