Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

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:

ParameterTypeReq?Description
ariaLabelstringNoSets 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.
onCompanyChangefunctionNoCallback 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);