Registering a custom component (Core)
Package: @formzk/core
Any React component that accepts a value + onChange pair can be registered. This example wires a react-color-style swatch picker — completely custom, yet still benefits from validation, form state, and the declarative API.
Loading playground…
What to try
- Click a swatch — form state updates, try submitting to see the current values.
- Remove the
declare moduleaugmentation intypes/formzk.d.ts— the form still runs (ComponentPropsOffalls back toany), you just lose autocomplete oncomponent="...". - Register a second custom component (e.g. a slider) and add a third
Formzk.Inputbound to it.