Demetria is a library written in TypeScript aimed at creating dynamic multi-step forms easily and efficiently.
You can install the library via npm:
npm install demetria
Here is an example of how to use Demetria to create a multi-step form:
import { MultiStepForm } from 'demetria';
const form = new MultiStepForm({
steps: [
{
name: 'Personal Information',
fields: [
{ type: 'text', label: 'Name', name: 'name', required: true },
{ type: 'email', label: 'Email', name: 'email', required: true },
]
},
{
name: 'Address',
fields: [
{ type: 'text', label: 'Street', name: 'street', required: true },
{ type: 'text', label: 'City', name: 'city', required: true },
{ type: 'text', label: 'State', name: 'state', required: true },
{ type: 'text', label: 'Zip Code', name: 'zip', required: true },
]
},
// Add more steps as needed
]
});
form.render('#form-container');
Contributions are welcome! Please open an issue or submit a pull request with your changes.
This project is licensed under the MIT License.