NotificationCenter

A notification-center frame composed from header, scroller, list, item, and action parts.

Preview#

The snippets show the default trigger. Brutal previews swap in a custom trigger through render to demonstrate the source bell affordance.

NotificationCenterPopup is the surface. NotificationCenterHeader, NotificationCenterScroller, NotificationCenterList, and NotificationCenterItem are content slots and should live inside the popup unless you intentionally provide your own shell.

import {
  NotificationCenter,
  NotificationCenterActionButton,
  NotificationCenterCount,
  NotificationCenterHeader,
  NotificationCenterItem,
  NotificationCenterItemActions,
  NotificationCenterItemBody,
  NotificationCenterItemContent,
  NotificationCenterItemIcon,
  NotificationCenterItemRow,
  NotificationCenterItemTitle,
  NotificationCenterList,
  NotificationCenterPopup,
  NotificationCenterScroller,
  NotificationCenterTitle,
  NotificationCenterTrigger,
} from "raft-ui";

<NotificationCenter>
  <NotificationCenterTrigger />
  <NotificationCenterPopup>
    <NotificationCenterHeader>
      <NotificationCenterTitle />
      <NotificationCenterCount />
    </NotificationCenterHeader>
    <NotificationCenterScroller>
      <NotificationCenterList>
        <NotificationCenterItem>
          <NotificationCenterItemRow>
            <NotificationCenterItemIcon />
            <NotificationCenterItemContent>
              <NotificationCenterItemTitle />
              <NotificationCenterItemBody />
              <NotificationCenterItemActions>
                <NotificationCenterActionButton />
              </NotificationCenterItemActions>
            </NotificationCenterItemContent>
          </NotificationCenterItemRow>
        </NotificationCenterItem>
      </NotificationCenterList>
    </NotificationCenterScroller>
  </NotificationCenterPopup>
</NotificationCenter>

Empty state#WIP

API#WIP

PropTypeDefaultDescription
openbooleanControlled open state owned by Base UI Popover.Root.
defaultOpenbooleanfalseInitial open state for uncontrolled usage.
modalboolean | "trap-focus"falseDefaults to non-modal to match the source rail/navbar floating popup.
onOpenChangePopover.Root.Props['onOpenChange']Called when trigger, Escape, or outside press changes open state.
...propsBase UI Popover.Root.PropsRoot popover props. Compose trigger, popup, and notification parts as children.
PropTypeDefaultDescription
...propsBase UI Popover.Trigger.PropsTrigger affordance and positioning anchor. Use render to compose a custom icon button; defaults to the themed bell/attention control.
PropTypeDefaultDescription
viewport"desktop" | "mobile""desktop"desktop = fixed width; mobile = viewport-capped width.
size"sm" | "md" | "lg""md"Frame height token. Desktop uses fixed heights; mobile uses max-height tokens.
side"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end""bottom"Anchored placement relative to the trigger, forwarded to Base UI Popover.Positioner.
align"start" | "center" | "end""center"Alignment along the anchored side, forwarded to Base UI Popover.Positioner.
positionMethod"fixed" | "absolute""fixed"Positioning strategy for the popup. The popup bundles Portal, Positioner, and Popup internally.
sideOffsetnumber4Gap between the trigger and the popup edge.
collisionAvoidanceCollisionAvoidanceHow the popup avoids viewport edges when space runs out.
portalPropsBase UI Popover.Portal.PropsOptional portal options (e.g. container) forwarded to the internal portal.
...propsBase UI Popover.Popup.PropsThe visual card. Popup owns the border, shadow, background, portal, and positioner.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Header row for title and count.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"span">Panel title text.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"span">Trailing count or clear-all label in the header.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Scroll boundary for the list or empty state.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"ul">Notification list. Defaults to aria-label='Notifications'.
PropTypeDefaultDescription
readbooleanfalseApplies the source read opacity treatment.
...propsuseRender.ComponentProps<"li">List item root. Compose row, icon, and content parts as children.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Horizontal layout for icon and content.
PropTypeDefaultDescription
status"error" | "warning" | "info" | "success""info"Applies the notification status color and default icon when children are omitted.
...propsuseRender.ComponentProps<"div">Status icon slot. Pass children to replace the default glyph.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Flexible column for title, body, and actions.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Notification title text.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Supporting body copy under the title.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Trailing action row for NotificationCenterActionButton children.
PropTypeDefaultDescription
variant"primary" | "secondary""secondary"Maps notification actions to the shared Button primary/outline variants.
...propsButtonPropsButton attributes. Size is fixed to xs; className merges with the action recipe.
PropTypeDefaultDescription
...propsEmptyStatePropsSemantic empty-state root. Compose EmptyStateContent with EmptyStateIcon, EmptyStateTitle, and EmptyStateDescription.