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

Get display name (Beta)

Was this page helpful?
Previous

Get Children (Beta)

Next
Built with

slot.getDisplayName()

Get the display name of the slot.

The display name reflects any user-customized label applied in the Designer and may differ from the prop name defined in the component source. When comparing slot names programmatically, verify that the value matches the expected label rather than the original prop name.

Beta

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

Syntax

1slot.getDisplayName(): Promise<string>

Returns

Promise<string>

A Promise that resolves to the slot’s display name, which may reflect user customization applied in the Designer rather than the original prop name.

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 display name of each slot
11 for (const slot of slots) {
12 const name = await slot.getDisplayName();
13 console.log(name); // e.g. 'Content' or 'Sidebar'
14 }
15
16} else {
17 console.log('No component instance found');
18}

Designer Ability

Checks for authorization only.

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny