Embed your JSONPost forms anywhere with a simple JavaScript snippet. Choose from multiple embed types and customize the appearance to match your website.
Get started in seconds by adding the SDK to your HTML
<script src="https://forms.jsonpost.com/embed/v1/embed.js"></script>
Opens a centered modal dialog with your form. Perfect for capturing attention without leaving the page.
<script src="https://forms.jsonpost.com/embed/v1/embed.js"></script>
<script>
const modal = FormEmbed.createModal('your-form-id', {
theme: 'bumblebee',
width: 800,
height: 600
});
// Call modal.open() when you want to show the form
modal.open();
</script>
Option | Type | Default | Description |
---|---|---|---|
theme | string | 'light' | DaisyUI theme name |
width | number|string | 800 | Modal width (px or %) |
height | number|string | 600 | Modal height (px or vh) |
Option | Type | Default | Description |
---|---|---|---|
theme | string | 'light' | DaisyUI theme name |
position | string | 'bottom-right' | 'bottom-right' or 'bottom-left' |
buttonIcon | string | (default) | URL to custom icon image |
buttonColor | string | '#3a7685' | Button background color |
width | number|string | 400 | Window width |
height | number|string | 600 | Window height |
Use any DaisyUI theme name to style your embedded forms
Complete HTML page with a button that opens a modal form
<!DOCTYPE html>
<html>
<head>
<title>Customer Feedback</title>
</head>
<body>
<h1>Welcome to Our Site</h1>
<button id="feedback-btn">Give Feedback</button>
<script src="https://forms.jsonpost.com/embed/v1/embed.js"></script>
<script>
const modal = FormEmbed.createModal('your-form-id', {
theme: 'bumblebee',
width: 700,
height: '80vh'
});
document.getElementById('feedback-btn').onclick = () => modal.open();
</script>
</body>
</html>
Automatically show a form modal after a few seconds
<script src="https://forms.jsonpost.com/embed/v1/embed.js"></script>
<script>
// Open modal after 3 seconds
setTimeout(() => {
FormEmbed.createModal('your-form-id', {
theme: 'corporate',
width: '80%',
height: 600
}).open();
}, 3000);
</script>
Important: On mobile devices (width < 768px), all embed modes automatically convert to fullscreen modals. Borders and rounded corners are removed for edge-to-edge display.
Control your embedded forms programmatically
const modal = FormEmbed.createModal(formId, options);
modal.open(); // Open the modal
modal.close(); // Close the modal
modal.toggle(); // Toggle open/closed state
const chatbox = FormEmbed.createChatbox(formId, options);
chatbox.open(); // Open the chatbox window
chatbox.close(); // Close the chatbox window
chatbox.toggle(); // Toggle open/closed state
chatbox.destroy(); // Remove chatbox and button from page
defer
width: '80%'
overflow: hidden
Start building beautiful forms with JSONPost and embed them anywhere on the web with our powerful SDK.