Skip to Content
Embed WidgetWidget (Floating Button)

Widget (Floating Button)

The widget embed adds a persistent floating button to the corner of your website. When clicked, it opens the scheduling UI in an overlay. This gives visitors a way to book a meeting from any page without you needing to modify each page’s layout.

Setup

Add the embed script with a single configuration element anywhere in your page:

<div data-proximity-mode="widget" data-proximity-user="jane-doe" data-proximity-event="30min-call" data-proximity-widget-text="Book a call" data-proximity-widget-color="#4F46E5" style="display: none;" ></div> <script src="https://app.proximity.io/embed/v1/proximity-embed.js" async></script>

The script reads the configuration and renders a floating button in the bottom-right corner of the viewport.

Configuration

AttributeRequiredDefaultDescription
data-proximity-modeYesMust be widget
data-proximity-userYesHost’s user slug
data-proximity-eventNoEvent type slug
data-proximity-widget-textNo"Book a meeting"Button label text
data-proximity-widget-colorNo#4F46E5Button background color (hex)
data-proximity-widget-positionNobottom-rightButton position: bottom-right or bottom-left
data-proximity-colorNoHost’s brand colorPrimary color for the scheduling UI
data-proximity-localeNoenUI language
data-proximity-hide-brandingNofalseHide “Powered by Proximity”

Widget Appearance

The floating button renders as a rounded pill with an icon and text:

┌──────────────────────┐ │ 📅 Book a call │ └──────────────────────┘

On mobile screens, the button automatically collapses to show only the icon to save space.

Positioning

Control which corner the button appears in:

<!-- Bottom-right (default) --> <div data-proximity-mode="widget" data-proximity-widget-position="bottom-right" ...></div> <!-- Bottom-left --> <div data-proximity-mode="widget" data-proximity-widget-position="bottom-left" ...></div>

The button has a fixed offset from the viewport edge and stays above any other fixed elements (z-index: 9999).

Programmatic Control

Control the widget from JavaScript:

// Show the widget (if initially hidden) window.proximityEmbed.showWidget(); // Hide the widget window.proximityEmbed.hideWidget(); // Open the scheduling overlay window.proximityEmbed.open(); // Close the scheduling overlay window.proximityEmbed.close();

Conditional Display

You might want to show the widget only on certain pages or for certain users:

// Show widget only on pricing and product pages const showWidgetOn = ['/pricing', '/product', '/features']; if (showWidgetOn.some(path => window.location.pathname.startsWith(path))) { window.proximityEmbed.showWidget(); }

Full Example

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Acme Inc.</title> </head> <body> <h1>Welcome to Acme</h1> <p>We build amazing products.</p> <!-- Widget config (hidden element, just for configuration) --> <div data-proximity-mode="widget" data-proximity-user="jane-doe" data-proximity-event="demo" data-proximity-widget-text="Talk to Sales" data-proximity-widget-color="#059669" data-proximity-widget-position="bottom-right" data-proximity-locale="en" style="display: none;" ></div> <script src="https://app.proximity.io/embed/v1/proximity-embed.js" async></script> <script> window.addEventListener('message', (event) => { if (event.origin !== 'https://app.proximity.io') return; if (event.data.type === 'proximity:booking-created') { // Track the conversion if (window.gtag) { gtag('event', 'booking_created', { event_category: 'scheduling', event_label: event.data.data.inviteeEmail, }); } } }); </script> </body> </html>
Last updated on