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:
{
"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.
| Rail | Disc | Badge |
|---|---|---|
actor | the actor's avatar | the activity's icon |
activity | the activity's icon | the actor's avatar |
actor-only | the actor's avatar | none |
activity-only | the activity's icon | none |
rail="actor"
rail="activity"
rail="actor-only"
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
rail="actor"
rail="actor" child-rail="activity-only"
rail="actor", no actor
rail="actor", several actors
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 style | Draws |
|---|---|
branch | the 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 |
dot | a 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
divider-style="dot"
Orders
Group State
interactive | collapsed | Groups |
|---|---|---|
true | null | open when the group has no headline of its own; otherwise closed |
true | true | closed |
true | false | open |
false | null | open, with no disclosure control |
false | true | closed, with no disclosure control; members stay in the HTML for printing |
:collapsed="true"
:collapsed="false"
:interactive="false"
:interactive="false" :collapsed="true"
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.
<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; }
--sf-gutter
The rail's width. Defaults to 2 × the font size.
.sf-feed { --sf-gutter: 5rem; }
--sf-gap
The space between the rail and the row. Defaults to 0.75 × the font size.
.sf-feed { --sf-gap: 2.5rem; }
--sf-disc
The disc's size. Defaults to 2 × the font size.
.sf-feed { --sf-disc: 2.5rem; }
--sf-badge
An icon badge's size, on the actor rail. Defaults to 0.875 × the font size.
.sf-feed { --sf-badge: 1rem; }
--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; }
--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; }
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; }
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; }
SYSTEM RESTART ........ COMPLETE
MANUAL INPUT .......... ACCEPTED
DOOR CONTROL .......... ONLINE
EXIT LOCKS ............ RELEASEDColour Tokens
The kits draw with the Laravel starter kits' colour tokens:
| Token | Use |
|---|---|
background, foreground | surface and text |
card | card surface |
muted, muted-foreground | secondary surface and text |
primary, primary-foreground | buttons and text on them |
border, ring | boundaries and focus rings |
Colour Tokens shows the theme block for an app without them.
Data Attributes
| Attribute | On | Holds |
|---|---|---|
data-sf-intent | the icon disc and badge | the glyph's intent, such as danger |
data-storyfeed-body | each body's wrapper, in Blade | nothing; a hook for your CSS |