Eidetic

AI Cloze Passage

AI
Authoring
Block

Fill-in-the-blank style prompt with inline variable inputs. Users complete a template by filling in highlighted blanks within the text.

Card Variant

Full card with template, variable reference, and preview

Fill-in-the-Blank Prompt

0/5 variables filled

Write a about for that is approximately words long.

Variables
ToneWriting style
FormatContent type
TopicMain subject
Audience
LengthApproximate word count
Preview

Write a {{tone}} {{format}} about {{topic}} for {{audience}} that is approximately {{length}} words long.

Inline Variant

Compact fill-in-the-blank

Fill in the blanks
0/3

Explain to a using examples.

Preview Variant

Side-by-side template and preview

Template

Write a about for that is approximately words long.

Preview

Write a {{tone}} {{format}} about {{topic}} for {{audience}} that is approximately {{length}} words long.

0/5 filled

Props

Component API reference

PropTypeDefaultDescription
template*stringTemplate text with {{variable_id}} placeholders
variables*ClozeVariable[]Variable definitions matching template placeholders
variant'card' | 'inline' | 'preview''card'Display variant
onSubmit(filledText: string, values: Record<string, string>) => voidCallback when submitted
onVariableChange(variableId: string, value: string) => voidCallback when a variable changes
loadingbooleanfalseWhether submission is loading
showPreviewbooleantrueShow preview of filled template

Usage

Import and examples

import { AIClozePassage } from '@/blocks/ai-conversation/ai-cloze-passage'
<AIClozePassage
template="Write a {{tone}} {{format}} about {{topic}}."
variables={[
{ id: 'tone', label: 'Tone', options: ['casual', 'formal'] },
{ id: 'format', label: 'Format', options: ['blog', 'article'] },
{ id: 'topic', label: 'Topic', placeholder: 'your topic' },
]}
onSubmit={(filledText, values) => console.log(filledText)}
/>

Built With

2 components

This block uses the following UI components from the design system:

Features

Built-in functionality

  • Inline blanks: Variables rendered as inline inputs within text flow
  • Select or text: Variables support dropdown options or free-text input
  • Live preview: Real-time preview of filled template
  • Copy support: Copy filled template to clipboard
  • Reset: Reset all variables to defaults
  • Dark mode: Full dark mode support

Accessibility

Accessibility considerations

ARIA Attributes

Inline inputs have associated labelsFilled/unfilled state indicated by color

Keyboard Navigation

KeyAction
TabNavigate between blank fields
EnterSubmit filled template

Notes

  • Input width adapts to content length
  • Color coding distinguishes filled vs empty blanks