@velnai/form-solid
v0.1.0
Published
Drop a Velnai form into any SolidJS app. Thin iframe wrapper with typed props + reactive callbacks.
Maintainers
Readme
@velnai/form-solid
Drop a Velnai lead-capture form into any SolidJS app.
npm install @velnai/form-solidUsage
import { VelnaiForm } from '@velnai/form-solid'
export function App() {
return (
<VelnaiForm
publicKey="frm_abc123"
prefill={{ email: '[email protected]' }}
onSubmit={() => alert('Thanks!')}
/>
)
}Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| publicKey | string | required | The form's public key. |
| prefill | Record<string, unknown> | — | Field values to pre-populate. |
| lang | string | — | Locale code. |
| 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). |
| onView | () => void | — | Form has booted. |
| onSubmit | () => void | — | Form submitted successfully. |
| onClose | () => void | — | Modal close requested. |
| onRedirect | (url) => boolean \| void | — | Return true to suppress default navigation. |
License
MIT
