Sales Notification
ProNewSocial proof in a corner: supplied purchases, stock alerts, bookings, reviews, follows and visitors appear as rotating notifications or a feed, with thumbnails, time and calls to action.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| items* | SalesNotificationItem[]The events to show, in order. They come from your own store or backend; the component fetches nothing. | — |
| layout | "toast" | "feed"`toast` shows one event at a time in a corner; `feed` lists them all in the page. | "toast" |
| position | "top-left" | "top-center" | "top-right" | "middle-left" | "middle-right" | "bottom-left" | "bottom-center" | "bottom-right"Where the toast sits when there is room for it beside the content. | "bottom-left" |
| mobilePosition | "top" | "bottom"Where the toast sits on a narrow screen, where it spans the width. | "bottom" |
| anchor | "viewport" | "parent"`viewport` pins the toast to the window; `parent` to the nearest positioned ancestor. | "viewport" |
| shape | "rounded" | "pill" | "square"Corner style of the notification. | "rounded" |
| delay | numberSeconds before the first notification. | 3 |
| duration | numberSeconds each notification stays. Hovering or focusing it holds it. | 6 |
| interval | numberSeconds between two notifications. | 4 |
| loop | booleanStart over after the last event. | true |
| dismissible | booleanShow the Close button and allow swiping the toast away; closing stops the cycle. | true |
| onDismiss | () => void | — |
| formatTime | (date: Date) => stringTurns a date into the relative time label, for other languages. | — |
| live | "polite" | "off"Whether screen readers hear each notification as it arrives. | "polite" |
| label | stringNames the region for assistive technology. | "Recent activity" |
| className | string | — |
Accessibility
- The notifications sit in a named region that is a polite live region, so each one is read when it arrives without taking focus; set `live="off"` to keep it quiet.
- Hovering or focusing a notification holds it on screen for as long as you need, and the cycle resumes when you leave.
- The action is a link or a button, the Close button is named, and Escape closes the notification while focus is inside it; closing stops the cycle.
- The thumbnail and badge are decoration unless you pass `imageAlt`, and a dated time is a `time` element with the exact moment.
- Under reduced motion notifications swap immediately without fading, dragging or a pulsing visitor dot.