Promo Toast
A corner card for one announcement. Its close button collapses it into a small round badge with a springy resize, and clicking the badge opens it again.
pixikit.com/docs/components/promo-toast
Customize
Position
Placement
Offset20px
Width300px
Radius20px
Collapsed size48px
Padding18px
Glow color
Background color
Text color
Blur20px
Duration0.52s
Bounce
Delay0.0s
Default open
Close on escape
Props
30| Name | Type | Default | Description |
|---|---|---|---|
brand | string | "Field Notes" | Small brand line at the top. |
title | string | "The winter release is ready to try" | The headline. |
lead | string | "New this season:" | Opening words of the body, set in the strong colour. |
body | string | "shared boards, a faster editor and a quieter inbox." | The rest of the body. |
ctaLabel | string | "See what changed" | Text of the link at the bottom. Leave empty for none. |
ctaHref | string | "#" | Where the link goes. |
icon | ReactNode | None | Brand mark shown in the card and on the collapsed badge. A sample mark shows when left out. |
position | "bottom-left" | "bottom-right" | "top-left" | "top-right" | "bottom-left" | Which corner it sits in, and collapses toward. |
placement | "fixed" | "absolute" | "inline" | "fixed" | `fixed` pins it to the window, `absolute` to the nearest positioned parent, `inline` leaves it in the page flow. |
offset | number | 20 | Distance from the corner, in px. |
width | number | 300 | Card width, in px. |
radius | number | 20 | Card corner radius, in px. |
collapsedSize | number | 48 | Size of the round badge it collapses into, in px. |
padding | number | 18 | Space inside the card, in px. |
glowColor | string | "#7c3aed" | Colour of the glow in the corner of the card. |
backgroundColor | string | "color-mix(in srgb, var(--foreground) 92%, transparent)" | Card fill. |
textColor | string | "var(--background)" | Text colour; the softer text and the hairlines are mixed from it. |
blur | number | 20 | Blur of the page behind the card, in px. |
duration | number | 0.52 | Seconds the card takes to collapse and to open. |
bounce | boolean | true | Lets the card overshoot a little as it settles. |
delay | number | 0 | Seconds before it first appears. |
defaultOpen | boolean | true | Starts open; false starts as the badge. |
open | boolean | None | Open state, when you hold it. |
onOpenChange | (open: boolean) => void | None | Called when the user collapses or opens it. |
storageKey | string | "" | Remembers the collapsed state in the browser under this key. |
closeOnEscape | boolean | false | Collapses on Escape while focus is inside. |
closeLabel | string | "Collapse announcement" | Screen reader text of the close button. |
openLabel | string | "Open announcement" | Screen reader text of the collapsed badge. |
className | string | "" | |
style | CSSProperties | None |