@velnai/form-vue
v0.1.0
Published
Drop a Velnai form into any Vue 3 app. Thin iframe wrapper with typed props + event emits.
Maintainers
Readme
@velnai/form-vue
Drop a Velnai lead-capture form into any Vue 3 app.
npm install @velnai/form-vueUsage
<script setup lang="ts">
import { VelnaiForm } from '@velnai/form-vue'
function onSubmitted() {
alert('Thanks!')
}
</script>
<template>
<VelnaiForm
public-key="frm_abc123"
:prefill="{ email: '[email protected]', name: 'Alex' }"
@submit="onSubmitted"
/>
</template>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| publicKey | string | required | The form's public key. |
| prefill | Record<string, unknown> | — | Field values to pre-populate, keyed by field name. |
| lang | string | — | Locale code (e.g. 'es'). |
| previewToken | string | — | Optional preview token for DRAFT forms. |
| formsBase | string | 'https://forms.velnai.com' | Override the forms host. |
| autoResize | boolean | true | Auto-resize iframe height to match content. |
| initialHeight | number | 600 | Initial iframe height (px). |
Events
| Event | Payload | When |
|---|---|---|
| view | — | The form has booted and is interactive. |
| submit | — | The visitor submitted successfully. |
| close | — | A modal-mode form requested to close. |
| redirect | (url, prevent) | The form wants to redirect. Call prevent() to suppress default navigation. |
License
MIT
