What it is
formFooter is a SwiftUI modifier on the Joyfill Form that adds your bottom bar—buttons, labels, validation hints, or any other views—above the home indicator and safe area. The SDK keeps that bar on screen as users move through the main form and many nested flows (for example chart detail, signature canvas, or table and collection row forms), so you do not have to rebuild the same toolbar on every screen yourself.
It is not configured on DocumentEditor or in JSON; it is plain SwiftUI you compose next to Form.
How to use
- Chain
.formFooter { … }onFormor on any parent that wrapsForm(the modifier only needs to sit aboveFormin the view hierarchy). - Build the footer inside the closure like any other SwiftUI view. You can use
@State,ObservableObject, and animations there; when that state changes, the footer updates.
- If you do not add
formFooter, the SDK does not add a footer; layout matches earlier versions. - Keep the footer compact when possible so it leaves enough room for form content; long footers still respect the safe area but reduce visible scroll area.
Show or hide the footer by page
You can turn the footer on or off for specific pages using the same page focus and blur callbacks described in Event handling. When the user moves to another page, the SDK callsonFocus with event.pageEvent (type is "page.focus") and calls onBlur on the previous page with "page.blur". Each PageEvent includes page (use page.id for that page’s _id in the doc).
- Keep a
Bool(or similar) in SwiftUI state—often@Publishedon anObservableObjectyou pass toDocumentEditorasevents:. - In
onFocus, whenevent.pageEventis set, update that flag frompage.id(for example hide the footer when the id is in aSetof pages that should not show actions). - Optionally use
onBlurwithevent.pageEventfor the sametype/page shape when you need logic tied to leaving a page. - In
.formFooter { }, only build the footer when your flag istrue(useif showFooter { … }).
Form does not need extra APIs; your existing FormChangeEvent implementation drives visibility.