Skip to content

A JavaScript form, no framework needed

Plain JavaScript, Svelte, Angular or Astro: one function builds the form in your page, with your CSS classes, texts and redirects.

Request access The detailed guide

In three steps

  1. Step 1 : Install the SDK (npm install @canardform/sdk) or load it from a CDN.

  2. Step 2 : Call mountForm on an element of the page with your form’s id.

  3. Step 3 : Adjust with the options: classes, messages, onSubmitted, beforeSubmit.

import { mountForm } from '@canardform/sdk';

await mountForm('#form', 'YOUR_FORM', {
    classes: { form: 'grid gap-4', submit: 'btn btn-primary' },
    onSubmitted: () => (window.location.href = '/thanks'),
});

What you gain

Frequently asked questions

With Svelte, Angular or Astro, where do I call mountForm?

In code that runs in the browser, once the element is on the page: onMount in Svelte, ngAfterViewInit in Angular, a client script in Astro. mountForm builds DOM and refuses to run on the server.

Can I write all the HTML myself?

Yes. createFormController, imported from @canardform/sdk/controller, provides state, validation, steps, conditions and submission without rendering anything: you keep full control of the markup.

How do I save where a visit came from (UTM, campaign)?

Add a hidden field to the form: it reads the page address parameter on its own, for example ?utm_source=newsletter. Keep beforeSubmit for a value only your site knows.

Your first form is 5 minutes away.

Free to start. Change plans only when you need to.