Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
Headless Adaptive Forms (HAF) present an innovative approach for crafting Form or Data Capture Experiences through a JSON representation. This versatile format enables seamless rendering across various channels. For example, Web Applications, Mobile Applications, Internet of Things (IoT), API-Driven Applications, Digital Signage, Kiosks and Self-Service Machines, Augmented Reality (AR) and Virtual Reality (VR).
These forms can be used in applications where the user interface is decoupled from the back end. This separation allows flexibility and enables developers to use different technologies on the front end.
The Headless Adaptive Forms (HAF) framework comprises three key components that enable its functionality:
Before diving into the setup, ensure that your machine meets the following prerequisites:
Once your React project is in place, use the following command to install Headless Adaptive Forms dependencies:
You can use Adaptive Forms editor for a visual form creation experience, allowing you to effortlessly generate Headless Form JSON in accordance with the specifications. You can also follow the Headless Forms specification to define a Headless Form.
The Mappings Object is a JavaScript map designed to map the field types outlined in the Headless Forms specification with their corresponding React components. This map is employed by the Adaptive Form Super Component to dynamically render the various components specified in the Form JSON.
The default mappings can be found in Headless Adaptive Forms Github repository. You can also use the Headless Adaptive Forms starter kit to create a React application with all the Headless Adaptive Forms related dependencies including a mapping file (mappings.ts) with all the default mappings.
To use Mappings Object in your own project or application, import the @aemforms/af-react-components
library:
Once you have defined the JSON for the form, the looks like the following:
You can easily add features like submission and multiple fields directly in the JSON structure. When you submit the form, the Adaptive Form Super Component's callbacks help extract the data effortlessly.
The Headless Adaptive Forms also has the capability to generate hierarchical data.