Vue
The Vue kit renders Storyfeed's serialized items with Vue 3 components. Copy it into your app and pass a feed page to FeedStream.
php artisan storyfeed:ui vue
npm install lucide-vue-next 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 @tailwindcss/typography<script setup lang="ts">
import FeedStream from '@/components/storyfeed/FeedStream.vue';
import type { FeedPagePayload } from '@/components/storyfeed/types';
defineProps<{ feed: FeedPagePayload }>();
</script>
<template>
<FeedStream :page="feed" />
</template>page takes the JSON of a page from cursorPaginate() or simplePaginate(), which holds the items in data, or the plain array get() returns. The copied kit includes its shared/ imports. Configure Tailwind scanning and the Typography plugin in the host app.
Loading Older Activity
<FeedStream :items="items" :next-cursor="nextCursor"
:loading-more="loading" @load-more="loadOlder" />The app fetches the next page from next_cursor and appends its data to items. loading-more disables the pager while loading. Keep the cursor opaque and follow the feed's sync token.
Replacing Row Content
| Slot | Receives | Replaces |
|---|---|---|
#body | { node } | body content |
#annotations | { node } | app annotations |
#time | { node, label } | timestamp content |
These slots reach activities, groups and expanded children. The #empty slot replaces the empty-page text. Built-in bodies render from the object’s bodies and data, and the activity’s data. Host seams supply links, app components and media.
Rails, day headings, dividers and group disclosure are set in Customizing the Kits.
Vue Components lists every component, prop, slot, event and injection key.