Skip to content
Components / Collections

Recency groups

Groups a history by Today, Yesterday, Previous 7 days, Previous 30 days, then month.

@fabrials/ui
Loading state

Grouped relative to 26 Sep 2026, 15:00.

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { groupByRecency, RECENCY_LABELS, TruncatedText } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
itemsreadonly T[]Records to group, in the order to keep inside each group.
getDate(item) => DateReads the date of one record. Strings and numbers work too.
nowDateReference time. Defaults to the current time.
optionsobjecttimeZone, locale and label overrides.

Behavior

A helper, not a component. Buckets follow calendar days in the given time zone. The host renders the groups.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.