TextElement

fancy-slides

Slide text element renderer.

Registry JSON
Why
Presentations need richly-formatted text across markdown, HTML, and plain text without rebuilding typography on every edit or forcing agents to scrape the DOM. Without TextElement, prose styles conflict with element scaling, text renders at wrong sizes in thumbnails, and agents memorize multiple content formats. TextElement solves this by storing markdown, scaling typography proportionally to the slide, and providing a WYSIWYG editor when authors select the element.
What
TextElement is a JSON-friendly data object holding content, format ("markdown", "html", "plain"), and style (typography properties). TextElementRenderer is a controlled React component that accepts the element, editing/selected flags, onContentChange, slideWidthPx, and optional paraReveal for animations. It scales typography proportionally, forces Tailwind prose styles to inherit element settings, and swaps to a react-fancy Editor (bold, italic, heading, bullets) when selected. Paragraph builds animate one paragraph per click.
How
Import TextElementRenderer from @particle-academy/fancy-slides, pass a TextElement object with content, optional format, and style shape, plus slideWidthPx and editing/selected flags from parent <Slide>. Wire onContentChange to bubble edits to deck state. For agents: the stable element.id and JSON-friendly shape enable element_update operations to mutate content, format, or style without DOM scraping.