Context Providers

A context provider is a logical component that shares state and behavior with visual components on a site. It has no UI of its own. Components connect to the values and functions it exposes through editor binding, which lets them stay coordinated without implementing the shared state themselves.

Studio Two calls a context provider extension a Data Source in the editor and the Wix Extension Builder. The generated code uses context provider APIs and React Context.

When to use a context provider

Use a context provider when several components need shared, stateful behavior. Common cases include:

  • Keeping a product selector, price display, and purchase button synchronized.
  • Sharing a filter across controls, a repeater, and a result count.
  • Exposing state-changing actions alongside the values they update.
  • Loading a resource once and making its state available to several components.

Use a function library instead when components need the same stateless calculation or transformation. Use ordinary component props when the state belongs to only 1 component and doesn't need editor binding.

How context providers work

A context provider has a manifest and a provider component:

  • The manifest declares the values and functions the provider exposes, along with any configuration inputs.
  • The provider component implements the state and behavior with React Context.

At design time, the editor reads the manifest so a Wix user can configure the provider and connect compatible component props to its exposed items. At runtime, the provider supplies the current values and functions to the connected components. When shared state changes, the connected components receive the updated values.

Wix and custom context providers

Wix business solutions provide contexts for coordinated site experiences. For example, a product context can expose product details, selected variants, pricing, inventory, and cart actions to the components on a product page.

You can also author a context provider for site-specific state. In Studio Two, you add it as a Data Source extension. The generated manifest and React component use context provider terminology in code.

Context providers across development paths

Context provider authoring is available for Studio Two sites. For the Studio Two behavior and workflow, see About Data Sources in Studio Two.

For the generated files, manifest fields, and implementation contract, see About Context Provider Extensions in Extension References.

See also

Last updated: 2 November 2026

Did this help?