Components
NotificationItem
Unstable: one row of activity in a panel or an inbox, who did what and when, as one link; unread rows are tinted, carry a dot and say "Unread". Import it from @nizivo/react/unstable/notification-item.
Examples
Basic
Two rows in a panel: an unread comment and a read one.
import type { JSX } from 'react';
import { Avatar } from '@nizivo/react/avatar';
import { NotificationItem } from '@nizivo/react/unstable/notification-item';
export function NotificationItemExample(): JSX.Element {
return (
<div style={{ display: 'grid', gap: 4, maxInlineSize: 420 }}>
<NotificationItem
href="/posts/autumn-launch#comments"
unread
avatar={<Avatar name="Jonah Okafor" decorative />}
title="Jonah Okafor commented on Autumn launch"
detail="“Love the new cover photo — ship it.”"
time={<time dateTime="2026-10-28T09:39">2 min ago</time>}
/>
<NotificationItem
href="/orders/1042"
avatar={<Avatar name="Maya Rao" decorative />}
title="Maya Rao placed order #1042"
detail="2 items · $84.00"
time={<time dateTime="2026-10-28T08:12">1 h ago</time>}
/>
</div>
);
}
Import
import { NotificationItem } from '@nizivo/react/unstable/notification-item';
// Once per app (Getting started), after
// @nizivo/tokens/tokens.css and @nizivo/react/css/base.css
import '@nizivo/react/css/notification-item.css';Static or interactive
Server. No client JavaScript: the row is a link (href, or render for a router link).
How to choose.
Content
title says what happened, detail adds a quote or a figure and time when (a <time> is
best). avatar takes an Avatar, decorative since the title names the
person. unread tints the row, adds a dot and starts its name with "Unread" (labels.unread), so
the state is never the tint alone.
Props
Server component Renders data-slot="notification-item" with the class nz-notification-item. Props: NotificationItemProps. Source: src/unstable/notification-item/notification-item.tsx.
| Name | Type | Default | Description |
|---|---|---|---|
avatar | ReactNode | – | An Avatar of who did it; decorative, since the title names them. |
detail | ReactNode | – | A line under it: a quote, a detail. |
labels | Partial<NotificationItemLabels> | – | |
render | RenderProp<Record<string, never>> | – | Must render an |
time | ReactNode | – | When, after the detail: a |
titlerequired | ReactNode | – | What happened: "Jonah Okafor commented on Autumn launch". |
unread | boolean | false |
- Also takes every attribute of
<a>excepttitle. (Omit<ComponentPropsWithRef<"a">, "title">)
render takes an element, or, in client code, a function of the props and no state.
Other exports
NotificationItemLabelstypeimport type { NotificationItemLabels } from '@nizivo/react/unstable/notification-item'NotificationItem's own strings (§16.4): serialisable, English defaults.
Name Type Default Description unreadrequiredstring'Unread'Read before an unread row's title.
NotificationItemPropstypeimport type { NotificationItemProps } from '@nizivo/react/unstable/notification-item'The props of
NotificationItem, listed above.
Data attributes and slots
Style parts by class (.nz-<slot>) and state by data attribute. Attribute meanings come from contracts/vocabulary.json.
| Slot | Rendered by | Data attributes |
|---|---|---|
notification-item.nz-notification-item | NotificationItemroot (takes render); interactive, focus: self |
|
notification-item-detail.nz-notification-item-detail | NotificationIteminner element (CSS only) | none |
notification-item-title.nz-notification-item-title | NotificationIteminner element (CSS only) | none |
CSS hooks
Set a hook on the component's class or any ancestor to restyle it without specificity games; leave it unset for the default shown.
This stylesheet reads no public hook.
Layers: nz.components. Classes: .nz-notification-item, .nz-notification-item-avatar, .nz-notification-item-detail, .nz-notification-item-dot, .nz-notification-item-text, .nz-notification-item-title.
Tokens this stylesheet reads (17)
--nz-bg-brand, --nz-bg-brand-subtle, --nz-bg-hover, --nz-duration-fast, --nz-easing-standard, --nz-font-body-s, --nz-font-label-m, --nz-radius-full, --nz-radius-lg, --nz-space-0-5, --nz-space-1, --nz-space-1-5, --nz-space-2, --nz-space-3, --nz-space-4, --nz-text-primary, --nz-text-secondary
Accessibility
These parts are interactive. Each gets the focus outline and touch-action rule from @nizivo/react/css/base.css (the nz.base layer), so the floor survives a restyle:
notification-item: draws the focus outline itself on keyboard focus.
Keyboard
To be written.
NewsletterSignup
Unstable: an email capture with a visible Email label, the browser's validation shown inline, a pending Subscribe button and a success message read aloud. Import it from @nizivo/react/unstable/newsletter-signup.
NumberField
A number in the reader's locale, a price, a percent or a unit, in Input's box. It formats on blur, parses what is typed in the locale, clamps to min and max, and steps with the arrow keys; step buttons are optional. A form gets the plain number.