DOCS
v0.4

AI Components / Prompt Template

Prompt Template

Template editor with {{variable}} highlighting and inline variable inputs.

ai-essentialsv0.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

PropTypeDefaultDescription
templatestringTemplate with {{vars}}
variablesRecord<string, string>Variable values
editablebooleantrueEnable editing

Events

EventDetailDescription
ai-template-variable-change{name, value}Variable changed