<astlide-deck> — show a built Astlide deck inside any page.
A framework-agnostic custom element: it loads the deck in an iframe at 16:9
(sized by its container's width) and drives it over a small postMessage
protocol. Works in plain HTML, Markdown/MDX pages, and any framework; see
@astlide/core/embed/react and @astlide/core/embed/vue for thin wrappers
and @astlide/core/components/DeckEmbed.astro for Astro sites.
Importing the module registers the element (in browsers only — it is safe to
import during SSR).
Protocol
Messages are plain objects. The host page sends
{ source: "astlide-embed", type: "hello" | "next" | "prev" | "goto", slide? }
to the iframe, targeted at the deck's origin. The deck page only listens when
it is framed, only to its parent window, and answers to the origin that sent
hello with { source: "astlide-deck", type: "slidechange", deck, slide, total, step, steps }.
The element in turn only accepts messages from its own iframe and the deck's origin.
<astlide-deck>— show a built Astlide deck inside any page.A framework-agnostic custom element: it loads the deck in an iframe at 16:9 (sized by its container's width) and drives it over a small
postMessageprotocol. Works in plain HTML, Markdown/MDX pages, and any framework; see@astlide/core/embed/reactand@astlide/core/embed/vuefor thin wrappers and@astlide/core/components/DeckEmbed.astrofor Astro sites.Importing the module registers the element (in browsers only — it is safe to import during SSR).
Protocol
Messages are plain objects. The host page sends
{ source: "astlide-embed", type: "hello" | "next" | "prev" | "goto", slide? }to the iframe, targeted at the deck's origin. The deck page only listens when it is framed, only to its parent window, and answers to the origin that senthellowith{ source: "astlide-deck", type: "slidechange", deck, slide, total, step, steps }. The element in turn only accepts messages from its own iframe and the deck's origin.