Skip to main content

Documentation Index

Fetch the complete documentation index at: https://osforms.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Props

PropTypeDefaultDescription
formIdstringForm slug from your dashboard. Fetches schema automatically.
schemaFormSchemaPass a schema directly (headless usage).
endpointstringSubmission URL. Required when using schema without formId.
baseUrlstringhttps://osforms.comOverride for self-hosted instances.
mode'conversational' | 'classic'schema defaultOverride the form’s render mode.
themePartial<FormTheme>Theme overrides merged with schema theme and defaults.
fullScreenbooleanfalseRenders the form fixed to the full viewport (position: fixed).
onComplete() => voidCalled when the form is successfully submitted.
onError(error: Error) => voidCalled when a submission error occurs.
loadingComponentReactNodeCustom loading state while schema is fetched.
errorComponentReactNodeCustom error state if schema fetch fails.

Examples

Full-screen conversational form

<OSForm
  formId="abc123"
  mode="conversational"
  fullScreen
  onComplete={() => router.push('/thanks')}
/>

Embedded classic form

<OSForm
  formId="abc123"
  mode="classic"
  theme={{ colors: { primary: '#6366f1' } }}
/>

Error handling

<OSForm formId="abc123" onError={(err) => toast.error(err.message)} />

Custom loading state

<OSForm
  formId="abc123"
  loadingComponent={<Spinner />}
  errorComponent={<p>Failed to load form.</p>}
/>