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
      • Slots
        • Get display name
        • Get Children
        • Prepend
        • Append
      • 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
  • slot.getChildren()
  • Syntax
  • Returns
  • Example
  • Designer Ability
ElementsElement Types & MethodsSlots

Get Children (Beta)

Was this page helpful?
Previous

Prepend (Beta)

Next
Built with

slot.getChildren()

Get the component instances currently placed in the slot.

Beta

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

Syntax

1slot.getChildren(): Promise<Array<ComponentElement>>

Returns

Promise<Array<ComponentElement>>

A Promise that resolves to an array of component instances in the slot.

If no slot override has been set at the instance level, this method returns an empty array even if the component defines default slot content.

Example

1// Get a component instance on the page
2const elements = await webflow.getAllElements();
3const componentInstance = elements.find(el => el.type === 'ComponentInstance');
4
5if (componentInstance?.type === 'ComponentInstance') {
6
7 // Get the slots on the instance
8 const slots = await componentInstance.getSlots();
9
10 // Print the children of each slot
11 for (const slot of slots) {
12 const name = await slot.getDisplayName();
13 const children = await slot.getChildren();
14 console.log(`Slot "${name}" has ${children.length} children`);
15 }
16
17} else {
18 console.log('No component instance found');
19}

Designer Ability

Checks for authorization only.

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny