BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ilinxa/engagement-bar

Engagement Bar

ilinxa/engagement-bar
FreeBlock

Social action row — like, comment, share, bookmark, custom actions, and a multi-reaction picker with realtime counts and burst animation.

Install it

npx shadcn@latest add https://ui.ilinxa.com/r/engagement-bar.json

Source

src/registry/components/data/engagement-bar/engagement-bar.tsxui.ilinxa.com/r/engagement-bar.json · first 6 KB
1"use client";
2
3import { memo, useEffect, useImperativeHandle, useMemo, useRef } from "react";
4import { cn } from "@/lib/utils";
5import {
6 DEFAULT_ENGAGEMENT_BAR_LABELS,
7 type EngagementAction,
8 type EngagementActionAlign,
9 type EngagementBarHandle,
10 type EngagementBarProps,
11 type EngagementBarLabels,
12 type EngagementState,
13} from "./types";
14import { ActionButton } from "./parts/action-button";
15import {
16 deriveStateFromActions,
17 useEngagementState,
18} from "./hooks/use-engagement-state";
19import { formatEngagementCount } from "./lib/format-count";
20
21interface EngagementBarInnerProps extends EngagementBarProps {
22 ref?: React.Ref<EngagementBarHandle>;
23}
24
25function defaultAlignFor(kind: EngagementAction["kind"]): EngagementActionAlign {
26 return kind === "bookmark" || kind === "view-count" ? "right" : "left";
27}
28
29function actionKey(action: EngagementAction, index: number): string {
30 if (action.kind === "custom") return `custom-${action.id}`;
31 return `${action.kind}-${index}`;
32}
33
34function EngagementBarInner({
35 actions,
36 variant = "default",
37 subscribe,
38 onSubscribeDelta,
39 likersPreview,
40 reactionsPreview,
41 labels: labelsProp,
42 className,
43 actionClassName,
44 ref,
45}: EngagementBarInnerProps) {
46 const { state, dispatch, controlled } = useEngagementState({
47 actions,
48 subscribe,
49 onSubscribeDelta,
50 });
51
52 const labels = useMemo<Required<Omit<EngagementBarLabels, "formatCount">>>(
53 () => ({ ...DEFAULT_ENGAGEMENT_BAR_LABELS, ...labelsProp }),
54 [labelsProp],
55 );
56
57 const format = useMemo<(n: number) => string>(
58 () => labelsProp?.formatCount ?? formatEngagementCount,
59 [labelsProp?.formatCount],
60 );
61
62 // Stable handle identity — refs mirror state + actions via passive effect
63 // (refs must not be written during render).
64 const stateRef = useRef<EngagementState>(state);
65 const actionsRef = useRef<EngagementAction[]>(actions);
66 useEffect(() => {
67 stateRef.current = state;
68 actionsRef.current = actions;
69 });
70
71 useImperativeHandle(
72 ref,
73 () => ({
74 triggerLike: () => {
75 const likeAction = actionsRef.current.find((a) => a.kind === "like");
76 if (!likeAction || likeAction.kind !== "like") return;
77 const next = !stateRef.current.liked;
78 if (likeAction.liked === undefined) {
79 dispatch({ kind: "like-toggle" });
80 }
81 likeAction.onToggle?.(next);
82 },
83 triggerBookmark: () => {
84 const bookmarkAction = actionsRef.current.find(
85// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • button
  • avatar
  • input
  • popover

Files it writes

  • src/registry/components/data/engagement-bar/engagement-bar.tsx
  • src/registry/components/data/engagement-bar/index.ts
  • src/registry/components/data/engagement-bar/types.ts
  • src/registry/components/data/engagement-bar/parts/action-button.tsx
  • src/registry/components/data/engagement-bar/parts/like-action.tsx
  • src/registry/components/data/engagement-bar/parts/comment-action.tsx
  • src/registry/components/data/engagement-bar/parts/share-action.tsx
  • src/registry/components/data/engagement-bar/parts/bookmark-action.tsx
  • src/registry/components/data/engagement-bar/parts/view-count-action.tsx
  • src/registry/components/data/engagement-bar/parts/custom-action.tsx
  • src/registry/components/data/engagement-bar/parts/engagement-heart-burst.tsx
  • src/registry/components/data/engagement-bar/parts/engagement-heart-burst.css
  • src/registry/components/data/engagement-bar/parts/likers-strip.tsx
  • src/registry/components/data/engagement-bar/parts/share-menu.tsx
  • src/registry/components/data/engagement-bar/parts/reaction-picker.tsx
  • src/registry/components/data/engagement-bar/parts/reaction-action.tsx
  • src/registry/components/data/engagement-bar/hooks/use-engagement-state.ts
  • src/registry/components/data/engagement-bar/lib/format-count.ts

Facts

Registry
ilinxa
Type
registry:block
Access
Free
Files written
18
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

ui.ilinxa.com ilinxa/pro-ui on GitHub Raw registry item This item as JSON

More from ilinxa

All 184 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Account Switcheraccount-switcherilinxaBlocksFree1 dep · 10 files
Account Switcher (deprecated alias)account-switcher-01ilinxaBlocksFreeno deps
Account Switcher — fixturesaccount-switcher-fixturesilinxaBlocksFreeno deps
App Sidebarapp-sidebarilinxaBlocksFree1 dep · 37 files
App Sidebar — fixturesapp-sidebar-fixturesilinxaBlocksFreeno deps
Rich Text Editor (deprecated alias)article-body-01ilinxaBlocksFreeno deps
Article Metaarticle-metailinxaBlocksFree1 dep · 4 files
Article Meta (deprecated alias)article-meta-01ilinxaBlocksFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex