Krizaka
Documentation

Activity feed

What happened, newest first: grouped by day, runs folded (“×3”), “2 min ago” kept fresh, new events announced — and Timeline, one thing's history on a rail.

Web + MobileBetaData display

Web and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.

When to use

  • Orazaka's job activity, Orochia's notifications and tips.
  • The bids of a live auction (live).
  • A payout's or a job's history (Timeline).

When not to use

  • For the steps still to come of a process.Use instead: Stepper
  • For records to browse or select.Use instead: List

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { ActivityFeed, Timeline } from "@krizaka/ui/activity-feed";

Examples

Activity

By day, three tips folded into one, how long ago.

Today

  1. Dubbing of “Sunset session” finished
  2. Elena started a dubbing jobEnglish, Spanish · 120 credits
  3. Mina tipped your video $5×3

Yesterday

  1. Clip job failed: the source is too short

Friday, Oct 9

  1. Your payout of $120 was sent

Live

New bids announced, each led by its bidder's avatar.

Today

  1. Alex bid $25

Timeline

A payout's history, oldest first.

  1. Payout requested$120.00 to the account ending 4821
  2. Funds reserved
  3. Sent to Stripe
  4. Arrived at the bank

Props

ActivityFeed

What happened, newest first: grouped by day, runs folded (“Mina tipped ×3”), “2 min ago” kept fresh, new events announced when live. Orazaka's job activity, Orochia's notifications, the console's audit log.

PropTypeDefaultDescription
aria-labelrequiredstring—The feed's accessible name (“Activity”).
eventsrequiredreadonly T[]—The events, in any order.
action((event: T) => ReactNode)—After an event's text: an action (Reply, View).
classNamestring—Classes merged on the root.
emptyReactNode—Shown when there is no event (an EmptyState).
foldbooleantrueFold the runs of the same actor and kind. Default true.
labelsPartial<ActivityFeedLabels>—The words, passed translated; English by default.
leading((event: T) => ReactNode)—Before an event's text: its actor's Avatar, an icon.
liveboolean—Announce new events politely (a stream).
localestringen-USThe locale of the dates and the “… ago”. Default en-US.
nowDate—Now, for the “… ago” and the day headings (pass it from the server for the same text on both sides).
tickingbooleantrueRefresh the “… ago” every minute. Default true.

Timeline

One thing's history on a rail, oldest first: each event a marker in its tone, its time and its words.

PropTypeDefaultDescription
aria-labelrequiredstring—The timeline's accessible name (“History of the payout”).
eventsrequiredreadonly T[]—One thing's events, oldest first (a job's run, a payout's life).
classNamestring—Classes merged on the list.
localestringen-USThe locale of the times. Default en-US.
timeStyle"date" | "time" | "datetime"timeHow a time is written: time (14:02, default), datetime, date.

Accessibility

  • Days are headings; each time is a time with its full date.
  • live announces how many new events arrived, politely, never each one.

Best practices

  • Write each event as a sentence (“Mina tipped your video $5”), passed translated.
  • Give actor and kind to fold repeated events.
  • Pass now from the server to render the same “… ago” on both sides.

Generated from the code of @krizaka/ui 3.5.0: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page