Engagement Bar — fixtures
ilinxa/engagement-bar-fixturesFreeBlock
Engagement Bar plus the dummy-data fixtures used by the docs-site demo.
Install it
npx shadcn@latest add https://ui.ilinxa.com/r/engagement-bar-fixtures.jsonSource
1import type {2 EngagementAction,3 EngagementDelta,4 EngagementLikeUser,5 Subscribe,6} from "./types";78const noop = () => {};910// Demo data uses UNCONTROLLED mode (no explicit `liked` / `bookmarked` fields)11// so clicks visibly flip via the bar's internal mirror. Passing `liked: false`12// would put the action in CONTROLLED mode (action.liked !== undefined), which13// means the host owns the value — clicks dispatch nothing visible because the14// noop callback doesn't update a host-side state. Pre-existing demos passed15// these explicit-false fields, which silently disabled interactivity. v0.3.016// fix: drop them; let the internal mirror drive.17export const DUMMY_POST_ENGAGEMENT: EngagementAction[] = [18 { kind: "like", count: 142, onToggle: noop },19 { kind: "comment", count: 23, onClick: noop },20 { kind: "share", count: 8, onClick: noop },21 { kind: "bookmark", onToggle: noop },22];2324export const DUMMY_NEWS_CARD_ENGAGEMENT: EngagementAction[] = [25 { kind: "like", count: 56, onToggle: noop },26 { kind: "share", onClick: noop },27 { kind: "bookmark", onToggle: noop },28];2930export const DUMMY_VIDEO_ENGAGEMENT_STACKED: EngagementAction[] = [31 { kind: "like", count: 1234, onToggle: noop },32 { kind: "comment", count: 87, onClick: noop },33 { kind: "share", count: 12, onClick: noop },34 { kind: "view-count", count: 12_345 },35];3637export const DUMMY_LIKE_USERS: EngagementLikeUser[] = [38 {39 id: "u1",40 name: "Ada Lovelace",41 username: "ada",42 avatar: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=80",43 },44 {45 id: "u2",46 name: "Grace Hopper",47 username: "grace",48 avatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=80",49 },50 {51 id: "u3",52 name: "Linus Torvalds",53 username: "linus",54 avatar: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=80",55 },56 {57 id: "u4",58 name: "Margaret Hamilton",59 username: "maggie",60 avatar: "https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=80",61 },62 {63 id: "u5",64 name: "Alan Turing",65 username: "alan",66 avatar: "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=80",67 },68];6970/**71 * Sandbox-only fake subscription. Fires a synthetic like-changed delta every 4s72 * for the realtime demo. Real consumers wire their own subscribe over websocket / SSE.73 */74export function createDummySubscribe(initialCount = 142): Subscribe<EngagementDelta> {75 return (handler) => {76 let current = initialCount;77// … truncated
What it pulls in
Other registry items
Files it writes
More from ilinxa
All 184 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Account Switcheraccount-switcher | ilinxa | Blocks | Free | 1 dep · 10 files | |
| Account Switcher (deprecated alias)account-switcher-01 | ilinxa | Blocks | Free | no deps | |
| Account Switcher — fixturesaccount-switcher-fixtures | ilinxa | Blocks | Free | no deps | |
| App Sidebarapp-sidebar | ilinxa | Blocks | Free | 1 dep · 37 files | |
| App Sidebar — fixturesapp-sidebar-fixtures | ilinxa | Blocks | Free | no deps | |
| Rich Text Editor (deprecated alias)article-body-01 | ilinxa | Blocks | Free | no deps | |
| Article Metaarticle-meta | ilinxa | Blocks | Free | 1 dep · 4 files | |
| Article Meta (deprecated alias)article-meta-01 | ilinxa | Blocks | Free | no deps |
