ShoppingListShareButton
Opt-in: create a shareable anonymous list from a set of SKUs and surface the copyable URL plus any SKUs the backend dropped as invalid.
import { ShoppingListShareButton } from "@evolve-storefront/feature-shopping-list/shopping-list-share-button";Renders inside ShoppingListProvider.
Preview
Usage
// Creates an anonymous list from the SKUs and shows its URL to copy.<ShoppingListShareButton skus={skus} />;Props
| Prop | Type | Description |
|---|---|---|
skus | string[] | SKUs to include in the shareable list. |
type? | "reset" | "button" | "submit" | |
isPending? | boolean | The action is running. The button keeps its label, so its width and
accessible name hold, shows a spinner and is |
variant? | ButtonVariant | |
tone? | ButtonTone | |
isIconOnly? | boolean | The button has no visible label, so it is square. Structural rather than a size: it says the button has nothing to be wide for, and says nothing about how big — the brand's control tokens still decide that. MoreNot inferred from the children. A kebab menu is as often a glyph or an SVG
as an |
asChild? | boolean | |
data-component? | undefined | A button's identity is not a caller's to rename — see |
description? | string | |
children? | ReactNode |
Any other props go to the root element, like on a plain HTML element.
Examples
With Invalid SkusA SKU the backend does not know is left out of the shared list and named in the dialog.
// The dialog names any SKU the backend dropped as invalid.<ShoppingListShareButton skus={["ESP-1KG", "DISCONTINUED-01"]} />;
