@osforms/react is the official React SDK for OSForms. It renders forms designed in the dashboard’s Builder tab, or forms you define locally, in two modes:
- Conversational: one field at a time, Typeform-style, with animated transitions
- Classic: all fields on one page, standard form layout
Installation
Basic usage
formId is the form’s slug. The schema is fetched from https://osforms.com/api/v1/f/{formId}/schema.
The form needs a schema saved in the Builder tab. For a form without one, the
schema endpoint returns
schema: null and OSForm renders nothing.Local schema
Pass a schema directly. No schema fetch is needed:What’s included
Modes overview
Conversational
- One field displayed at a time
Enterto advance (Cmd/Ctrl+Enterin a textarea); ↑/↓ buttons to move back and forward- Animated field transitions (framer-motion, installed as a dependency)
- Auto-advances on selection for
radio,select,rating, andscalefields
Classic
- All visible fields on one page
- Standard form layout
- Submit button at the bottom
- Inline error under each invalid field
stepped mode exists in the types but currently renders the conversational layout.