Components
Overview of the dynamic form components available in the Mantlz SDK
Mantlz Form Components
The Mantlz SDK provides React components for creating dynamic forms. All form configurations are managed through the Mantlz dashboard and fetched automatically based on form IDs.
Mantlz Component
The main component that dynamically renders any type of form based on its configuration:
import { mantlz } from '@mantlz/nextjs';
<mantlz
formId="your-form-id"
title="Form Title"
description="Form description"
/>
Key Features
Dynamic Form Configuration
All forms are dynamically configured through the Mantlz dashboard:
- Form fields and validation rules are fetched automatically
- Update form structure without code changes
- Add, remove, or modify fields through the dashboard
- Maintain consistent form behavior across implementations
Form Type Features
Depending on the form type configured in the dashboard, additional features are available:
Waitlist Forms
For forms configured as waitlist type:
<mantlz
formId="your-waitlist-form-id"
showUsersJoined={true} // Show number of users who joined
usersJoinedLabel="people on the waitlist" // Custom label
usersJoinedPosition="top" // Position of the counter: "top" | "bottom"
/>
Feedback Forms
For forms configured as feedback type:
<mantlz
formId="your-feedback-form-id"
showRating={true} // Show star rating input
ratingLabel="Rate your experience" // Custom rating label
/>
Event Handlers
Handle form submissions and errors with callback functions:
<mantlz
formId="your-form-id"
/>
Appearance Customization
While fields are dynamic, you can still customize the form's appearance:
<mantlz
formId="your-form-id"
appearance={{
elements: {
// Customize button style
formButtonPrimary: 'bg-slate-500 hover:bg-slate-400 text-sm',
// Customize input style
input: 'bg-zinc-100 border-zinc-300',
// Customize card style
card: 'shadow-lg rounded-lg',
// Style users joined counter (for waitlist forms)
usersJoinedCounter: 'text-xl font-bold text-purple-600',
usersJoinedLabel: 'text-sm text-gray-600',
},
}}
/>
Post-Submission Redirects
Redirect users after successful form submission (STANDARD and PRO plans):
<mantlz
formId="your-form-id"
redirectUrl="/thank-you"
/>
Available Props
Prop | Type | Description |
---|---|---|
formId | string | Required. The ID of the form in your Mantlz dashboard. |
theme | string | The theme to use. Default: 'default' |
appearance | object | function | Custom styles to apply to the form. |
title | string | Form title text. |
description | string | Form description text. |
className | string | Additional CSS classes to apply to the form container. |
redirectUrl | string | URL to redirect to after successful submission (premium). |
showUsersJoined | boolean | Show users joined counter (waitlist forms only). |
usersJoinedLabel | string | Label for users joined counter. |
usersJoinedPosition | 'top' | 'bottom' | Position of users joined counter. |
showRating | boolean | Show rating input (feedback forms only). |
ratingLabel | string | Label for rating input. |
Getting Started
To get started with dynamic forms:
- Install the SDK
- Create and configure your form in the Mantlz dashboard
- Copy your form ID and implement the mantlz component
- Add form submission handlers
- Deploy your form!