Element Types & Methods
Element Types & Methods
Each element in Webflow has a specific type that determines its functionality and available methods. While all elements share some common properties, each element type also has specialized methods that allow you to manipulate that element’s unique characteristics.
Identifying element types
You can identify an element’s type using the element.type property:
Element presets
To add a specific element type to the canvas, you can use the webflow.elementPresets object, which contains a set of presets for different element types available in the designer.
Element type methods
Different element types have unique methods tailored to their functionality. Always check an element’s type before applying type-specific methods.
Best Practices for Element Type Methods
-
Always check element type before applying type-specific methods:
-
Handle multiple element types with type guards:
-
Combine property and type checks for maximum safety: