Pre-1.0. Not intended for public use yet. The API is subject to undocumented change, and these pages may already be wrong about it.

Skip to content

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.

bash
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
resources/js/pages/History.vue
vue
<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>
Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy

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 ​

resources/js/pages/History.vuetemplate
vue
<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 ​

SlotReceivesReplaces
#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.

Released under the MIT License.