SchemaAiAssistantButton
Opens an AI assistant dialog pre-filled with the current form's field values. The dialog talks to a backend AI endpoint and lets the user apply the suggestions back into the form.
The button ships in habarico-enterprise, and so does the backend it talks to. The ai-assistant
action type stays in the free vocabulary — without the paid frontend package the action simply
renders nothing.
enterpriseButtonProvider mounts it for you wherever the resource schema exposes an ai-assistant
action, so a backend that enables the AI integration gets the button without any frontend change
beyond installing the package. Mount it by hand only on a form you assembled yourself.
Example
import {SchemaAiAssistantButton} from '@eluvia/habarico-enterprise';
<SchemaAiAssistantButton endpoint={actionSchema.endpoint} label="AI assistant" />;
Props
On top of endpoint it accepts every ActionButtonProps except type — label, icon,
surface, showLabel, variant, color, size, loading, disabled, tooltip, confirm,
resource, onSuccess, sx, className.
| Name | Type | Default | Description |
|---|---|---|---|
endpoint (required) | ResourceActionEndpointParameters | — | The ai-assistant action's endpoint, taken from the action schema |
icon | ReactElement | the Task icon | Button icon |
label | ReactNode | — | Button label; without one the button renders icon-only with a tooltip |
How the dialog is mounted
The button registers the dialog through
useFormExtensions' registerFormExtension, so
FormShell renders it inside the form element rather than
in a portal — the dialog keeps full react-hook-form access to the fields it is about to fill. The
registration is removed when the button unmounts.
Outside a form — in a list toolbar, say — nothing renders the registry, so the dialog never mounts and the button does nothing. The AI assistant belongs on create and edit views.
See also
- AI integration — the backend endpoint behind the dialog
- SchemaPredictiveTextInput — completing a single field instead of a whole form
- Form extensions — how the dialog is mounted inside the form
- Button provider — where the button is resolved from