Callouts
Callouts (admonitions) render high-signal boxes with a semantic tone palette, an optional editable title slot, and full nested rich-text body blocks.
- Included in:
notesConfiguration,documentConfiguration - Pure-Dart import:
package:vyuh_document_elements/callout.dartorpackage:vyuh_document_elements/vyuh_document_elements.dart - Flutter extension:
CalloutDocumentExtension(bundled inDocumentEditorElements.defaults) - Action namespace:
CalloutActions
Quick example
dart
import 'package:vyuh_document/vyuh_document.dart';
import 'package:vyuh_document_elements/vyuh_document_elements.dart';
final doc = Document.of(notesConfiguration, [
Callout(
tone: CalloutTone.warning,
title: 'Breaking change in 0.89',
blocks: [
Paragraph('Use DocumentEditor with readOnly mode instead of DocumentViewer.'),
],
),
]);What you can configure
| Property | Type / Values | Purpose |
|---|---|---|
tone | CalloutTone (info, warning, tip, danger, note) | Selects the semantic icon, accent border, title ink, and tinted background |
title / header | String? / single-line editable header | Optional callout heading editable directly inline or via SetCalloutTitle |
blocks | List<DocumentBlock> | Full nested body story (paragraphs, lists, code blocks, links) |
styleId | String? | Optional named style binding |
Actions & commands
| Action ID | Effect |
|---|---|
CalloutActions.insert | Insert a new callout block |
CalloutActions.toneInfo | Switch active callout to CalloutTone.info |
CalloutActions.toneWarning | Switch active callout to CalloutTone.warning |
CalloutActions.toneTip | Switch active callout to CalloutTone.tip |
CalloutActions.toneDanger | Switch active callout to CalloutTone.danger |
CalloutActions.toneNote | Switch active callout to CalloutTone.note |
- Typed commands:
SetCalloutTone,SetCalloutTitle— both execute canonically through undo/redo history.
Restricting usage
- Remove callouts:
notesConfiguration.withoutElements([Callout.element]) - Limit available tones in chrome: Expose only the subset of
CalloutActions.tone*actions your brand uses (for exampletoneInfoandtoneWarning) in yourActionGroupand gate the others inDocumentPolicy.
Format parity
| DOCX | HTML | Markdown | |
|---|---|---|---|
| Shaded bordered callout box preserving title & nested blocks | Crisp tinted frame with accent rule and title | <aside data-callout-tone="..."> | GFM alerts (> [!WARNING], > [!TIP], > [!NOTE], > [!IMPORTANT], > [!CAUTION]) |