Skip to content

Wishlist Slots

The Wishlist drop-in exposes slots for customizing specific UI sections. Use slots to replace or extend container components. For default properties available to all slots, see Extending drop-in components.

ContainerSlots
Wishlistimage, actions
WishlistItemactions

The slots for the Wishlist container allow you to customize its appearance and behavior.

interface WishlistProps {
slots?: {
image?: SlotProps<{
defaultImageProps: ImageProps;
item: Item;
}>;
actions?: SlotProps<ProductItemActionsContext>;
};
}

The image slot allows you to customize the image section of the Wishlist container.

import { render as provider } from '/@dropins/storefront-wishlist/render.js';
import { Wishlist } from '/@dropins/storefront-wishlist/containers/Wishlist.js';
await provider.render(Wishlist, {
slots: {
image: (ctx) => {
// Your custom implementation
const element = document.createElement('div');
element.innerText = 'Custom image';
ctx.appendChild(element);
}
}
})(block);

The actions slot replaces the action buttons (such as move-to-cart and remove) for each product in the Wishlist container. The slot context provides item (the wishlisted product) and the optional onMoveToCart and onRemove callbacks.

import { render as provider } from '/@dropins/storefront-wishlist/render.js';
import { Wishlist } from '/@dropins/storefront-wishlist/containers/Wishlist.js';
await provider.render(Wishlist, {
slots: {
actions: (ctx) => {
// Your custom implementation
const element = document.createElement('button');
element.innerText = 'Move to cart';
element.addEventListener('click', () => ctx.onMoveToCart?.());
ctx.appendChild(element);
}
}
})(block);

The slots for the WishlistItem container allow you to customize a single wishlist product.

interface WishlistItemProps {
slots?: {
actions?: SlotProps<ProductItemActionsContext>;
};
}

The actions slot replaces the action buttons for a single wishlist item. The slot context provides item (the wishlisted product) and the optional onMoveToCart and onRemove callbacks.

import { render as provider } from '/@dropins/storefront-wishlist/render.js';
import { WishlistItem } from '/@dropins/storefront-wishlist/containers/WishlistItem.js';
await provider.render(WishlistItem, {
item: sampleWishlistItem,
slots: {
actions: (ctx) => {
// Your custom implementation
const element = document.createElement('button');
element.innerText = 'Move to cart';
element.addEventListener('click', () => ctx.onMoveToCart?.());
ctx.appendChild(element);
}
}
})(block);