Loading...
Loading...
> Smart form completion that uses AI to populate fields based on context.
The AI Autofill component demonstrates intelligent form completion. Enter a company name, click autofill, and watch AI populate related fields. Visual indicators show which fields were filled by AI. Perfect for onboarding flows and lead capture.
DESC: Import the autofill form into your page.
1import { AiAutofill } from '@/components/library/ai-autofill';
Use without API for testing and demos.
1export default function Page() {2 return <AiAutofill />;3}
Connect to your autofill backend.
1export default function Page() {2 const handleAutofill = async (companyName: string) => {3 const response = await fetch('/api/ai/autofill', {4 method: 'POST',5 body: JSON.stringify({ companyName }),6 });7 return await response.json();8 };910 return <AiAutofill onAutofill={handleAutofill} />;11}
| Option | Type | Default | Description |
|---|---|---|---|
| onAutofill | (context: string) => Promise<Partial<AutofillFormData>> | undefined | Async callback for fetching autofill data. |
| className | string | undefined | Additional CSS classes for the container. |
The default implementation includes these fields: