Function Libraries

A function library bundles reusable, stateless functions that a Wix user can connect to components in the editor. It gives components shared logic, such as formatting a value or validating input, without adding state or a lifecycle.

Function libraries are currently only available for Studio Two sites.

When to use a function library

Use a function library when unrelated components need the same calculation or transformation. Common cases include:

  • Formatting dates, currencies, or text consistently across components.
  • Validating values with a shared rule.
  • Converting a value from one data type to another during editor binding.

Use a context provider instead when components need to share state or coordinated behavior. A function library has no state of its own.

Group functions by domain rather than collecting unrelated utilities in one library. Focused libraries are easier for Wix users to find and reuse in the editor.

How function libraries work

A function library consists of a manifest and an implementation:

  • Manifest: Declares each function's name, parameters, and return type so the editor can present compatible functions as connectable options.
  • Implementation: Exports the functions declared in the manifest.

At design time, a Wix user connects a library function to a compatible component slot through editor binding. At runtime, Wix loads the implementation, calls the connected function, and passes its result to the slot.

Wix also provides built-in function libraries. For example, a type-conversion library can bridge a mismatch when a Wix user connects a phone number to a component property that expects rich text.

Function libraries across development paths

  • Sites:
    • Studio Two: Add function libraries directly to the site project through the Wix Extension Builder. They're part of the Studio Two component model, alongside Editor React Components and Data Sources. Data Source is the Studio Two name for a context provider extension. For how function libraries behave in a site, see About Function Libraries in Studio Two. To add one, see Add a Function Library Extension in Studio Two. For the file structure and manifest fields, see the function library reference in Extension References.
    • Wix Studio and Wix Editor: Don't support function libraries.
  • Wix-managed headless projects: Don't support function libraries. Headless projects use a custom frontend, so there's no editor binding for a function to connect through.
  • Self-managed headless projects: Don't support function libraries.
  • Wix-managed apps: Don't support function libraries.
  • Self-managed apps: Don't support function libraries.
  • Blocks apps: Don't support function libraries.

Last updated: 2 November 2026

Did this help?