Skip to content
PixiKit

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
NameTypeDefaultDescription
brandstring"Field Notes"Small brand line at the top.
titlestring"The winter release is ready to try"The headline.
leadstring"New this season:"Opening words of the body, set in the strong colour.
bodystring"shared boards, a faster editor and a quieter inbox."The rest of the body.
ctaLabelstring"See what changed"Text of the link at the bottom. Leave empty for none.
ctaHrefstring"#"Where the link goes.
iconReactNodeNoneBrand 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.
offsetnumber20Distance from the corner, in px.
widthnumber300Card width, in px.
radiusnumber20Card corner radius, in px.
collapsedSizenumber48Size of the round badge it collapses into, in px.
paddingnumber18Space inside the card, in px.
glowColorstring"#7c3aed"Colour of the glow in the corner of the card.
backgroundColorstring"color-mix(in srgb, var(--foreground) 92%, transparent)"Card fill.
textColorstring"var(--background)"Text colour; the softer text and the hairlines are mixed from it.
blurnumber20Blur of the page behind the card, in px.
durationnumber0.52Seconds the card takes to collapse and to open.
bouncebooleantrueLets the card overshoot a little as it settles.
delaynumber0Seconds before it first appears.
defaultOpenbooleantrueStarts open; false starts as the badge.
openbooleanNoneOpen state, when you hold it.
onOpenChange(open: boolean) => voidNoneCalled when the user collapses or opens it.
storageKeystring""Remembers the collapsed state in the browser under this key.
closeOnEscapebooleanfalseCollapses on Escape while focus is inside.
closeLabelstring"Collapse announcement"Screen reader text of the close button.
openLabelstring"Open announcement"Screen reader text of the collapsed badge.
classNamestring""
styleCSSPropertiesNone

Related