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
      • Element Presets
      • DOM Elements
      • Strings
      • Components
        • Get Component
        • Search props
        • Get Props
        • Get Resolved Props
        • Set Props
        • Reset All Props
        • Get Slots
        • Get Selected Slot
        • Get Text Prop Element
        • Unlink Component
      • Slots
      • Headings
      • Images
      • Links
      • Forms
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • element.getTextPropElement(propId)
  • Syntax
  • Parameters
  • Returns
  • Example
  • Designer Ability
ElementsElement Types & MethodsComponents

Get Text Prop Element (Beta)

Was this page helpful?
Previous

Unlink Component (Beta)

Next
Built with

element.getTextPropElement(propId)

Returns the TextPropElement or RichTextPropElement that corresponds to a textContent or richText prop on a component instance. Returns null if the prop does not exist or is not a text-based prop.

Text prop elements behave like containers — use their append() and prepend() methods to insert child elements directly into the prop’s content area.

Beta

These methods are in public beta and may change with future releases.

Syntax

1element.getTextPropElement(propId: string): Promise<TextPropElement | RichTextPropElement | null>

Parameters

  • propId: string — The ID of the prop. Retrieve prop IDs using element.getProps() or element.searchProps().

Returns

Promise<TextPropElement | RichTextPropElement | null>

A Promise that resolves to a TextPropElement (for textContent props) or RichTextPropElement (for richText props), or null if the prop does not exist or is not a text-based prop type.

Example

1const elements = await webflow.getAllElements();
2const componentInstance = elements.find(el => el.type === 'ComponentInstance');
3
4if (componentInstance?.type === 'ComponentInstance') {
5 const props = await componentInstance.getProps();
6 const textProp = props.find(p => p.type === 'textContent');
7
8 if (textProp) {
9 const propEl = await componentInstance.getTextPropElement(textProp.id);
10
11 if (propEl) {
12 const name = await propEl.getDisplayName();
13 const children = await propEl.getChildren();
14 console.log(`Prop element "${name}" has ${children.length} child(ren)`);
15 }
16 }
17}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny