React
The React kit renders Storyfeed's serialized items with React 19 components. Copy it into your app, wrap the feed in FeedProvider, and pass a feed page to FeedStream.
php artisan storyfeed:ui react
npm install react@^19 react-dom@^19 lucide-react micromark \
micromark-extension-gfm-autolink-literal \
micromark-extension-gfm-strikethrough \
micromark-extension-gfm-table \
micromark-extension-gfm-task-list-item \
sanitize-html
npm install -D @types/react @types/react-dom @types/sanitize-html \
@tailwindcss/typographyimport { Link } from '@inertiajs/react';
import { FeedProvider, FeedStream } from '@/components/storyfeed';
import type { FeedPagePayload } from '@/components/storyfeed';
export default function History({ feed }: { feed: FeedPagePayload }) {
return (
<FeedProvider FEED_LINK={Link}>
<FeedStream page={feed} />
</FeedProvider>
);
}page takes the JSON of a page from cursorPaginate() or simplePaginate(), which holds the items in data, or the plain array get() returns. It works with Inertia’s React adapter and Laravel’s React starter kit. The copied shared/ directory makes the imports self-contained. Configure Tailwind scanning and the Typography plugin.
Loading Older Activity
<FeedStream items={items} nextCursor={nextCursor}
loadingMore={loading} onLoadMore={loadOlder} />The app fetches the next page from next_cursor and appends its data to items. loadingMore disables the pager. Follow the feed's sync token. empty accepts a React node for an empty page.
Replacing Row Content
| Render Prop | Receives | Replaces |
|---|---|---|
body | { node } | body content |
annotations | { node } | app annotations |
time | { node, label } | timestamp content; null omits time |
These functions reach activities, groups and expanded children. Return null from time to omit the timestamp; the other metadata still renders. Nested providers inherit the outer options; explicit values win. See Host Seams.
Rails, day headings, dividers and group disclosure are set in Customizing the Kits.
Server Rendering
SSR and the first hydration render use ISO timestamps and UTC day keys. After mounting, labels use the browser's locale and calendar timezone. FEED_NOW pins the clock in milliseconds; otherwise relative labels refresh according to age.
React Components lists every component, prop, render prop and provider option.