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 et mobile — le même composant pour React et React Native. Bêta : son API peut encore changer à une version mineure.
Quand l’utiliser
- 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).
Quand ne pas l’utiliser
Installation
Installer
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Importer
import { ActivityFeed, Timeline } from "@krizaka/ui/activity-feed";Exemples
Activity
By day, three tips folded into one, how long ago.
Today
- Dubbing of “Sunset session” finished
- Elena started a dubbing jobEnglish, Spanish · 120 credits
- Mina tipped your video $5×3
Yesterday
- Clip job failed: the source is too short
Friday, Oct 9
- Your payout of $120 was sent
Live
New bids announced, each led by its bidder's avatar.
Today
- Alex bid $25
Timeline
A payout's history, oldest first.
- Payout requested$120.00 to the account ending 4821
- Funds reserved
- Sent to Stripe
- 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.
| Prop | Type | Défaut | Description |
|---|---|---|---|
aria-labelrequis | string | — | The feed's accessible name (“Activity”). |
eventsrequis | readonly T[] | — | The events, in any order. |
action | ((event: T) => ReactNode) | — | After an event's text: an action (Reply, View). |
className | string | — | Classes merged on the root. |
empty | ReactNode | — | Shown when there is no event (an EmptyState). |
fold | boolean | true | Fold the runs of the same actor and kind. Default true. |
labels | Partial<ActivityFeedLabels> | — | The words, passed translated; English by default. |
leading | ((event: T) => ReactNode) | — | Before an event's text: its actor's Avatar, an icon. |
live | boolean | — | Announce new events politely (a stream). |
locale | string | en-US | The locale of the dates and the “… ago”. Default en-US. |
now | Date | — | Now, for the “… ago” and the day headings (pass it from the server for the same text on both sides). |
ticking | boolean | true | Refresh 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.
| Prop | Type | Défaut | Description |
|---|---|---|---|
aria-labelrequis | string | — | The timeline's accessible name (“History of the payout”). |
eventsrequis | readonly T[] | — | One thing's events, oldest first (a job's run, a payout's life). |
className | string | — | Classes merged on the list. |
locale | string | en-US | The locale of the times. Default en-US. |
timeStyle | "date" | "time" | "datetime" | time | How a time is written: time (14:02, default), datetime, date. |
Accessibilité
- Days are headings; each time is a
timewith its full date. liveannounces how many new events arrived, politely, never each one.
Bonnes pratiques
- Write each event as a sentence (“Mina tipped your video $5”), passed translated.
- Give
actorandkindto fold repeated events. - Pass
nowfrom the server to render the same “… ago” on both sides.
Composants liés
Générée depuis le code de @krizaka/ui 3.5.0 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub
Achievement
Something done, and what it replaced: a milestone reached, a dare completed, a problem out of the way — on one grid of hairlines in a list, their badges arriving one by one; with three line emblems.
Avatar
A person or an account: their picture, or initials while it loads, when it fails or when there is none.