Skip to main content
The header placement adds a button that opens the Swish drawer. It displays a heart icon and an optional badge showing how many items the customer has saved. By default, Swish places this button in your store’s header through the app embed.

Setup

Use swish.placements.create() to position the button in your header. Target the container where your header icons live.

Styling

Pass design tokens under design to match the button to your header style.
Left alone, the button looks like the theme’s own header icons: a 44px button around a 20px heart drawn in the header’s text colour, with the badge centred on the heart’s corner and no ring around it. Set iconSize, iconStrokeWidth or iconColor to change it.

Customize the button

Control what the button shows using element props:
By default the badge is hidden when nothing is saved. showZeroCount keeps it visible at zero — it acts on the count, so it has no effect alongside hideCount.
With no text, the button has nothing to render beside the icon, so it stays icon-only whatever iconOnly says.

Programmatic creation

Create the button outside of the placement system:

Further reading