# App, notification inbox

- **[Sections](/blocks/)**
- **[Application](/blocks/app/)**
- **App, notification inbox**

An inbox of notifications grouped by day: unread items marked with a dot and the word, an unread count in a live region, All and Unread filters, and Mark all as read.

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/app-notifications-inbox
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/app-notifications-inbox';
  ```

Also called

- app/notifications-inbox

- **About**: An inbox of notifications grouped by day: unread items marked with a dot and the word, an unread count in a live region, All and Unread filters, and Mark all as read. Opening an item marks it read in place. Filled and empty states.
- **Category**: Interface sections for signed-in products. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: A page of notifications grouped by day, with unread marking and a filter. For one short list of alerts inside a settings area, `app-settings-notifications` is the block that controls what gets sent; this one shows what already arrived.
- **Writing for it**: - Group labels hold 30 characters and read best as days: Today, Yesterday. The groups run newest first, and you get at most 3 groups of 5 items.
- An item title holds 80 characters and the body 160. Put the event in the title and the detail in the body, and give href a real destination because opening the link marks the item read.
- unreadWord (20) is read aloud beside unread items, so use a word that makes sense on its own, such as Unread, not a symbol.
- **Watch out for**: A day group with no visible items is hidden, and with the Unread filter on and everything read, a message from messages.allRead takes its place. Leave allRead empty and that moment is silent.

## Pairs well with

- **[App, notification preferences](/blocks/app/settings-notifications)**
- **[App, top bar](/blocks/app/shell-topbar)**
- **[App, stat panel row](/blocks/app/dashboard-stats)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppNotificationsInbox from '@/components/klarhimmel/blocks/app-notifications-inbox';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppNotificationsInbox props={{
          "eyebrow": "Inbox",
          "title": "Notifications",
          "description": "Say what happened while the person was away.",
          "filterLabel": "Show",
          "filters": {
            "all": "All",
            "unread": "Unread"
          },
          "unreadSuffix": "unread",
          "unreadWord": "Unread",
          "markAll": "Mark all as read",
          "groups": [
            {
              "label": "Today",
              "items": [
                {
                  "title": "Say what happened, in a short line",
                  "body": "Add the detail that matters.",
                  "time": "00:00",
                  "unread": true,
                  "href": "#n1"
                }
              ]
            }
          ],
          "state": "filled",
          "messages": {
            "emptyTitle": "Nothing new",
            "emptyBody": "Say which events show up here.",
            "allRead": "Say everything has been seen."
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **eyebrow**: Text, up to 60 characters. Optional; empty is not rendered.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters. Optional; empty is not rendered.
- **filterLabel**: Text, up to 40 characters.
- **filters**: Fields: all, unread.
- **unreadSuffix**: Text, up to 20 characters.
- **unreadWord**: Text, up to 20 characters.
- **markAll**: Text, up to 30 characters.
- **groups**: List of 1 to 3. Each item: label, items.
- **state**: One of 'filled', 'empty'.
- **messages**: Fields: emptyTitle, emptyBody, allRead.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/app/files-list)

[Next](/blocks/app/onboarding-checklist)
