DOCS
v0.4

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

PropTypeDefaultDescription
template string Template with {{vars}}
variables Record<string, string> Variable values
editable boolean true Enable editing

Events

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