Flows
Build richer form flows from one field config.
Pages, tabs, progress, conditional groups, dependent choices, and debounced submits all live in Formedible config. Add only the pieces your form needs.
Multi-page forms
Pages come from the fields. Formedible reads each field page, checks page conditions, and keeps pages that still have a visible field.
- Set page?: number on a field; fields without page land on page 1.
- Use FormediblePageConfig for the page title, description, and optional condition.
- useFormedible returns currentPage, totalPages, visiblePages, navigation helpers, and progressValue.
Tabbed forms
Tabs group the same field list in a different way. A tab shows only when its condition passes and at least one visible field uses that tab id.
- tabs: ['personal'] works because normalizeTabs turns strings into { id, label } objects.
- If tabs is missing, Formedible infers tab ids from field.tab.
- Tab labels and descriptions can use dynamic text tokens.
Progress indicators
Progress is read-only display state. useMultiPage calculates the current visible step, then FormProgress receives the title, description, value, and display flags.
- progressValue is 100 when one visible page exists.
- With multiple visible pages, progressValue is the current visible-page index divided by the last visible-page index, multiplied by 100.
- Page titles and descriptions resolve dynamic text before FormProgress receives them.
Conditional UI
Fields, pages, and tabs share the same conditional shape. A string checks whether a field path is truthy; a function gets current values and returns a boolean.
- conditionMatches handles page and tab conditions; shouldRenderField handles field conditions.
- String conditions call getValueAtFieldPath, then coerce the result with Boolean.
- Function conditions are best for branches like individual, business, and premium paths.
Dynamic options
Choice fields accept a static option list or an option function. Select, radio, combobox, autocomplete, and multi-select fields call the function with current values before rendering.
- options can be readonly FormedibleFieldOption[] or (values) => readonly FormedibleFieldOption[].
- resolveFieldOptions maps string options to { value, label } objects.
- Use an option function for cases like country-based state or province lists.
Auto-submit
Auto-submit lives in useFormedible, not in each field. On change, Formedible updates TanStack Form, calls formOptions.onChange, and schedules a debounced submit when autoSubmitOnChange is true.
- Each new change clears the previous timeout before scheduling the next submit.
- autoSubmitDebounceMs controls the delay; useFormedible defaults to 300 ms.
- The unmount effect clears a pending auto-submit timeout.