Menu

Notification

Inbox / activity item. 2 statuses × 2 types.

NJ

Nusrat JahanreviewedSylhet green

2 min ago

IJ

Israt JahanshippedOrder #1042

Yesterday

Installation

$ npx uix-ui@latest add notification

This copies the file into components/ui/notification.tsx in your project. npx shadcn@latest add @uix/notification works too.

Usage

notification.tsx
import { Notification } from "@/components/ui/notification";

<div style={{ width: 440, display: "grid", gap: 4 }}>
  <Notification avatar={<Avatar size="sm" initials="NJ" />} name="Nusrat Jahan" action="reviewed" target="Sylhet green" time="2 min ago" />
  <Notification status="read" avatar={<Avatar size="sm" initials="IJ" />} name="Israt Jahan" action="shipped" target="Order #1042" time="Yesterday" />
</div>

Props

PropTypeDefaultDescription
statusunread | read"unread"
avatarReact.ReactNode–Avatar at the start (for example <Avatar initials="RS" />).
nameReact.ReactNode–
actionReact.ReactNode–What happened, for example "commented on".
targetReact.ReactNode–
timeReact.ReactNode–
actionsReact.ReactNode–Buttons under the message (Accept / Decline).

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close