AI Components / Prompt Template
Prompt Template
Template editor with {{variable}} highlighting and inline variable inputs.
ai-essentials v0.5.0
Playground
Examples
Template
<ai-prompt-template editable style="max-width:500px;"></ai-prompt-template> Import
import { AiPromptTemplate } from '@cognivo/components'; // Or tree-shake: import '@cognivo/components/ai-prompt-template'; Per-component imports ship only that component (~8 kB gzip).
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
template | string | — | Template with {{vars}} |
variables | Record<string, string> | — | Variable values |
editable | boolean | true | Enable editing |
Events
| Event | Detail | Description |
|---|---|---|
ai-template-variable-change | {name, value} | Variable changed |