Attributes
Custom element
Section titled “Custom element”<formbuilder-form form="…" lang="nl" isolate="shadow"></formbuilder-form>| Attribute | Default | Meaning |
|---|---|---|
form |
required | Form id. The uuid, not the slug, so a pasted snippet survives a rename |
lang |
the form’s base | Render a specific translation |
api |
the script’s origin | Endpoints on a different host |
isolate |
auto |
shadow seals the form from page CSS |
Object values are properties, not attributes:
el.prefill = { email: 'ada@example.com' };Loader
Section titled “Loader”Everything is data-fb-*, on the container for inline mode or on the
script tag for overlay modes.
| Attribute | Default | Meaning |
|---|---|---|
data-fb-form |
required | Form id |
data-fb-mode |
inline |
inline, popup, drawer, button |
data-fb-isolate |
auto |
shadow, iframe, none |
data-fb-lang |
the form’s base | Translation |
data-fb-api |
the script’s origin | Endpoints elsewhere |
data-fb-field-<name> |
none | Prefill a field |
data-fb-prefill-url |
1 |
Read prefills from the page query string |
data-fb-height |
auto |
Fixed iframe height |
data-fb-trigger |
click |
click, load, delay, scroll, exit |
data-fb-trigger-selector |
none | What to bind the trigger to |
data-fb-delay |
5000 |
ms, for delay |
data-fb-scroll |
50 |
percent, for scroll |
data-fb-once |
session |
session, forever, never |
data-fb-position |
right |
Drawer side |
data-fb-size |
md |
Overlay width |
data-fb-api is only needed when the bundle and the endpoints are on
different hosts. Otherwise the loader takes the origin of its own src,
which is right in every ordinary deployment.