Quick start
1. Write a Svelte field component:How it works
WhenFormFieldLight renders a field, it:
- Calls
resolveFieldComponent(schema)to check the registry - If a registered matcher returns
true, renders the registered component - Otherwise falls back to built-in fields (text, number, toggle, select, etc.)
Field component props
Your component receives these props:schema.minDate) directly from the schema via the form context — see Reading sibling field values below.
Matcher functions
A matcher decides whether your component handles a given schema:Priority-based resolution
When multiple registrations match, the highest priority wins:Lazy registration
For heavy dependencies, use dynamic imports:Built-in field types
These fields are always available without registration:
These require explicit registration (heavy dependencies):
Each installer takes the target field registry (
fd.fields) as its first argument:
Field management
Field management is done through the instance’sfd.fields registry (a FieldComponentRegistry):
Reading sibling field values
Custom components registered forformat: "autocomplete" fields receive the full schema object as a prop and can read the current values of other fields in the same form using the FORM_VALUES_KEY context.
This is the building block for dependent autocomplete fields — for example a project field whose suggestions depend on the currently selected account.
1. Define the schema — use any custom property to declare the dependency:
FormAutocomplete and patch the URL:
dependencies property:
format: "autocomplete" and a dependencies property. All other autocomplete fields continue to use FlowDrop’s built-in FormAutocomplete.
FormAutocomplete is a named export.Import it with import { FormAutocomplete } from '@flowdrop/flowdrop/form/autocomplete'.