For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
      • Get Element Snapshot
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • webflow.getElementSnapshot()
  • Syntax
  • Parameters
  • Returns
  • Examples
  • Get a snapshot
  • Render snapshot as an image
  • Designer Ability
UtilitiesElement Inspection

Get element snapshot

Was this page helpful?
Previous

User events & notifications

Next
Built with

webflow.getElementSnapshot()

Captures a snapshot of the specified element.

Syntax

1webflow.getElementSnapshot(element: AnyElement): Promise<null | string>

Parameters

ParameterTypeDescription
elementAnyElementThe element to capture a snapshot of.

Returns

A Promise that resolves to a base64 string representing the snapshot of the element, or null if the snapshot could not be captured. The string is a PNG image and includes the data:image/png;base64, prefix, making it ready to use directly as an image source.

Examples

Get a snapshot

1const selectedElement = await webflow.getSelectedElement();
2
3if (selectedElement) {
4 const snapshot = await webflow.getElementSnapshot(selectedElement);
5 console.log("Snapshot:", snapshot); // base64 string
6} else {
7 console.log("No element selected");
8}

Render snapshot as an image

1const selectedElement = await webflow.getSelectedElement();
2const img = document.getElementById("snapshot-image") as HTMLImageElement;
3
4if (selectedElement) {
5 const snapshot = await webflow.getElementSnapshot(selectedElement);
6
7 if (snapshot) {
8 // Get an existing image element and set the base64 string as source
9 img.src = snapshot;
10 }
11}

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny