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

Pages, Rails and Styles ​

The values all three kits share: the page shapes they read, the rails, the group states and the CSS variables. The attribute and prop names are on Blade Components, Vue Components and React Components.

Page Shapes ​

page takes whatever a read returns: the collection from get(), or the paginator from cursorPaginate(), simplePaginate() or members(). Blade takes the PHP value; Vue and React take its JSON, with the nodes in data:

json
{
    "data": [{ "id": "01K…", "type": "activity", "headline": "…" }],
    "next_cursor": "eyJpZCI6…",
    "sync_token": null,
    "payload_version": 1
}

The next page's cursor is next_cursor. get() and simplePaginate() have none. Pages from core 0.18 and earlier, a FeedPage whose JSON keeps the nodes in items, still work.

Pass items and next-cursor instead of page to draw nodes you hold yourself, such as pages appended after "Older activity". An explicit items or next-cursor wins over the one read from page. The node shape is The Payload Contract.

Rails ​

The rail is the column on the left of each row: a disc and, on it, a badge.

RailDiscBadge
actorthe actor's avatarthe activity's icon
activitythe activity's iconthe actor's avatar
actor-onlythe actor's avatarnone
activity-onlythe activity's iconnone

rail="actor"

Erica Sinclair

rail="activity"

Erica Sinclair

rail="actor-only"

Erica Sinclair

rail="activity-only"

Rows default to actor-only and expanded group members to activity-only. Members follow child-rail when it is set, else their group's rail, and draw no badge. A row without the disc's subject draws the other one, then a blank disc. A row with several actors draws two faces in the disc and never a face badge.

rail unset

Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy
Tue 2 Jul, 12:20 PM
Tue 2 Jul, 12:15 PM
Tue 2 Jul, 12:10 PM

rail="actor"

Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy
Erica Sinclair
Tue 2 Jul, 12:20 PM
Erica Sinclair
Tue 2 Jul, 12:15 PM
Erica Sinclair
Tue 2 Jul, 12:10 PM

rail="actor" child-rail="activity-only"

Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy
Tue 2 Jul, 12:20 PM
Tue 2 Jul, 12:15 PM
Tue 2 Jul, 12:10 PM

rail="actor", no actor

Someone placed Order #1035 with Scoops Ahoy

rail="actor", several actors

Robin BuckleyDustin Henderson
Robin BuckleyDustin HendersonErica Sinclair

Vue and React also take a rail as { primary, secondary }, each slot one of actor, activity or none, the two never the same.

Dividers ​

Divider styleDraws
branchthe default: a curve off the rail into the label, darkening from the rail's colour (border) to the label's (muted-foreground); the rail line stops a small gap above it
dota small hollow ring on the rail, in the rail's colour (border), the label beside it

The style applies to day headings and to the labels in dividers. dividers is keyed by item id: { "01K…": "Timeline" }.

divider-style="branch"

Orders

Erica Sinclair

divider-style="dot"

Orders

Erica Sinclair

Group State ​

interactivecollapsedGroups
truenullopen when the group has no headline of its own; otherwise closed
truetrueclosed
truefalseopen
falsenullopen, with no disclosure control
falsetrueclosed, with no disclosure control; members stay in the HTML for printing

:collapsed="true"

Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy

:collapsed="false"

Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy
Tue 2 Jul, 12:20 PM
Tue 2 Jul, 12:15 PM
Tue 2 Jul, 12:10 PM

:interactive="false"

Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy
Tue 2 Jul, 12:20 PM
Tue 2 Jul, 12:15 PM
Tue 2 Jul, 12:10 PM

:interactive="false" :collapsed="true"

Erica Sinclair
Erica Sinclair placed 3 orders with Scoops Ahoy

A group whose node has expanded: true opens in every case. Expanding shows the members the node carries; it fetches nothing.

CSS Variables ​

Set them on the feed or on any element around it.

blade
<x-storyfeed::feed :page="$page" class="[--sf-font-size:0.875rem]" />

--sf-font-size ​

The feed's body text. The other sizes follow it, and so do Tailwind's --spacing, --text-xs, --text-sm and --text-base inside the feed, so your own slot content on those utilities scales with the feed. Defaults to 1rem.

.sf-feed { --sf-font-size: 1.25rem; }

Erica Sinclair

--sf-gutter ​

The rail's width. Defaults to 2 × the font size.

.sf-feed { --sf-gutter: 5rem; }

Erica Sinclair

--sf-gap ​

The space between the rail and the row. Defaults to 0.75 × the font size.

.sf-feed { --sf-gap: 2.5rem; }

Erica Sinclair

--sf-disc ​

The disc's size. Defaults to 2 × the font size.

.sf-feed { --sf-disc: 2.5rem; }

Erica Sinclair

--sf-badge ​

An icon badge's size, on the actor rail. Defaults to 0.875 × the font size.

.sf-feed { --sf-badge: 1rem; }

Erica Sinclair

--sf-badge-face ​

An avatar badge's size, on the activity rail. Defaults to 1.125 × the font size.

.sf-feed { --sf-badge-face: 1.25rem; }

Erica Sinclair

--sf-prose-max-h ​

The height at which code and verbatim Prose scroll. Defaults to 24 × the font size.

.sf-feed { --sf-prose-max-h: 6rem; }

Hawkins Lab lock status was printed at Hawkins Lab
Hawkins Lab lock status
SYSTEM RESTART ........ COMPLETE
MANUAL INPUT .......... ACCEPTED
DOOR CONTROL .......... ONLINE
EXIT LOCKS ............ RELEASED

--sf-code-bg ​

Verbatim Prose's background. Defaults to #18181b.

.sf-feed { --sf-code-bg: #1e3a5f; }

Hawkins Lab lock status was printed at Hawkins Lab
Hawkins Lab lock status
SYSTEM RESTART ........ COMPLETE
MANUAL INPUT .......... ACCEPTED
DOOR CONTROL .......... ONLINE
EXIT LOCKS ............ RELEASED

--sf-code-fg ​

Verbatim Prose's text. Defaults to #f4f4f5.

.sf-feed { --sf-code-fg: #fde68a; }

Hawkins Lab lock status was printed at Hawkins Lab
Hawkins Lab lock status
SYSTEM RESTART ........ COMPLETE
MANUAL INPUT .......... ACCEPTED
DOOR CONTROL .......... ONLINE
EXIT LOCKS ............ RELEASED

Colour Tokens ​

The kits draw with the Laravel starter kits' colour tokens:

TokenUse
background, foregroundsurface and text
cardcard surface
muted, muted-foregroundsecondary surface and text
primary, primary-foregroundbuttons and text on them
border, ringboundaries and focus rings

Colour Tokens shows the theme block for an app without them.

Data Attributes ​

AttributeOnHolds
data-sf-intentthe icon disc and badgethe glyph's intent, such as danger
data-storyfeed-bodyeach body's wrapper, in Bladenothing; a hook for your CSS

Released under the MIT License.