CompanySwitcher Container
Allows users to switch between multiple companies they have access to using a dropdown selector.
Version: 1.0.6-beta5
Configuration
The CompanySwitcher container provides the following configuration options:
| Parameter | Type | Req? | Description |
|---|---|---|---|
ariaLabel | string | No | Sets a custom aria-label for the company picker dropdown. Use to improve accessibility by providing descriptive text for screen readers, especially when the picker is embedded in contexts where the default label may not be clear. |
onCompanyChange | function | No | Callback function to be called when the company changes |
Slots
This container does not expose any customizable slots.
Usage
The following example demonstrates how to use the CompanySwitcher container:
import { render as provider } from '@dropins/storefront-company-switcher/render.js';import { CompanySwitcher } from '@dropins/storefront-company-switcher/containers/CompanySwitcher.js';
await provider.render(CompanySwitcher, { ariaLabel: "Label", onCompanyChange: onCompanyChange,})(block);