> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Context Providers

## Article: Context Providers

## Article Link: https://dev.wix.com/docs/overview/extensions-framework/site-extensions/context-providers.md

## Article Content:

# 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](https://dev.wix.com/docs/overview/extensions-framework/site-extensions/function-libraries.md) 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](https://dev.wix.com/docs/studio-two/code-your-site/code-model/data-sources/about-data-sources.md).

For the generated files, manifest fields, and implementation contract, see [About Context Provider Extensions](https://dev.wix.com/docs/site-extensions/context-providers/about-context-provider-extensions.md) in Extension References.

## See also

- [Function Libraries](https://dev.wix.com/docs/overview/extensions-framework/site-extensions/function-libraries.md)
- [Editor React Components](https://dev.wix.com/docs/overview/extensions-framework/site-extensions/editor-react-components.md)
- [About Site Extensions](https://dev.wix.com/docs/overview/extensions-framework/site-extensions/about-site-extensions.md)