Smoothstream exposes two milestones for each mounted response. Both require receiving to become false and fire once, in order:
| Milestone | When it fires | Typical use |
|---|---|---|
| Reveal complete | The final presentation unit has entered the committed DOM. Its entrance animation may still be running. | Show suggested replies or another application component. |
| Presentation complete | All Smoothstream entrances have finished and temporary reveal nodes have compacted to semantic HTML. | Measure the final layout or run work that needs settled Markdown. |
React and the DOM adapter call onRevealComplete and onPresentationComplete. Vue emits reveal-complete and presentation-complete. Closing input does not itself mean either milestone has fired. Browser paint cannot be observed precisely, so reveal complete means the final unit is committed and beginning its entrance, rather than a guarantee about an exact painted pixel.
Put a component between Markdown segments
Keep application controls outside Smoothstream’s managed Markdown subtree. Show them at reveal complete, then mount a separate Smoothstream instance for the selected continuation. Each instance parses its own Markdown document, so finish the first segment at a complete block boundary.
Lifecycle details
- A final image waits until it has decoded or failed before entering, so it can delay reveal complete. In animated streaming mode, resources that gate reveal have resolved or failed before presentation complete. Images can still load afterward in static or reduced-motion mode.
- Static mode and reduced motion can deliver both callbacks in the same commit. An empty response also delivers both. Neither fires while
receivingistrue. - Unmounting or destroying the instance cancels pending callbacks. For React and Vue, changing timing props rebuilds playback; keep them stable within a response.
- The callbacks do not replace Smoothstream’s accessibility announcement. Keep your follow-up controls accessible and outside the Markdown subtree; see Accessibility.
In the repository, run npm run demo, npm run demo:vue, or npm run demo:vanilla, then select Callbacks: interactive handoff to see the milestones and continuation stream.