Velo: About Mixins

What Is a Mixin?

A mixin is a class that exists solely to provide properties and functions to other classes. Using mixins, you can simulate inheritance between classes. 

For example, I might have different classes for various elements, such as buttons, menus, datePickers, and dropdowns. Each of these elements are clickable. Instead of defining similar functions for each of them, I can "mix" the ClickableMixininto each each of these classes. Each class then has access to the same functionality.

Velo comes with several mixins that many of its APIs use. Velo mixins are Wix code editor Elements ($w).

This article describes and links to each mixin in the Velo Reference.

Which Functions and Properties Are From Mixins?

When looking at the Velo Reference, mixin functions and properties are described along with any  functions and properties that are unique to the class. This gives you a complete list of any functions and properties you can use with the API, regardless of their source.

After an API's summary of functions and properties, before its Introduction, referenced mixins are listed.

Click one of the links to see which functions and properties come from a mixin and not the current API you are viewing.

Note: Mixins can comprise other mixins. For example, the HiddenCollapsedMixin is a superset of the HiddenMixin and the CollapsedMixin.

Velo Mixins

The table below presents each mixin. Click its link to see its functions and properties in the Velo Reference.

MixinDescription
CheckedMixinProvides functionality for elements that can be be checked.
ClickableMixinProvides functionality for elements that can be clicked.
CollapsedMixinProvides functionality for elements that can be collapsed.
ContainableMixinProvides functionality for elements that can contain other elements.
DisabledMixinProvides functionality for elements that can be disabled.
ElementProvides basic functionality for elements.
EventProvides properties for events that are fired when certain actions occur to elements.
FocusMixinProvides functionality for elements that can set and lose focus.
FormElementProvides functionality related to user input elements.
HiddenCollapsedMixinProvides functionality for all elements that can be hidden or collapsed.
HiddenMixinProvides functionality for elements that can be hidden.
LabelMixinProvides functionality for elements that have a label.
LinkableMixinProvides functionality for elements that can act as links.
NodeProvides functionality for all Wix objects, including objects that are not elements.
PlayableMixinProvides functionality for elements that can be played.
ReadOnlyMixinProvides functionality for input elements that support readonly mode.
RequiredMixinProvides functionality for input elements that can be required to have a value.
StyleProvides an object representing an element's styles.
StyleMixinProvides functionality for elements that can be styled.
TextInputMixinProvides functionality for elements that accept text as input.
ValidatableMixinProvides functionality for elements that can be validated.
ValueMixinAdds the value property to elements.
ViewportMixinProvides functionality for elements that can be scrolled into and out of view.
Was this helpful?
Yes
No