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.getSlots()
  • Syntax
  • Returns
  • Example
  • Designer Ability
ElementsElement Types & MethodsComponents

Get Slots (Beta)

Was this page helpful?
Previous

Get Selected Slot (Beta)

Next
Built with

element.getSlots()

Get all slots on a component instance.

This method returns an array of SlotInstanceElement objects, one for each slot defined on the component. Each slot can contain component instances that you can read or modify using the slot’s own methods.

Beta

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

Syntax

1element.getSlots(): Promise<Array<SlotInstanceElement>>

Returns

Promise<Array<SlotInstanceElement>>

A Promise that resolves to an array of SlotInstanceElement objects. The array order matches the order in which the slots appear in the Designer’s instance properties panel.

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 all slots on the instance
8 const slots = await componentInstance.getSlots();
9
10 for (const slot of slots) {
11 const name = await slot.getDisplayName();
12 const children = await slot.getChildren();
13 console.log(`Slot "${name}" has ${children.length} children`);
14 }
15
16} else {
17 console.log('No component instance found');
18}

Designer Ability

Checks for authorization only.

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny