@molecule/app-activity-feed-solid

Feature · activity-feed · App (browser) · v1.1.0 · Apache-2.0

Solid activity feed rows and date-grouped feed container

npm install @molecule/app-activity-feed-solid

npm · Source on GitHub

How it works

@molecule/app-activity-feed-solid is a ready-made activity-feed feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { ActivityFeed, ActivityFeedGroup } from '@molecule/app-activity-feed-solid'

const items = [
  { id: '1', actor: 'Alice', verb: 'commented on', target: 'PR #42', timestamp: '2m ago' },
  { id: '2', actor: 'Bob', verb: 'closed', target: 'Issue #7', timestamp: '1h ago' },
]

export function Activity() {
  return (
    <>
      <ActivityFeed items={items} emptyState={<p>No activity yet.</p>} />
      <ActivityFeedGroup heading="Today" items={items} />
    </>
  )
}

Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid

Reference

Solid activity-feed primitives — the Solid counterpart of @molecule/app-activity-feed-react: the same props (React names) and the same DOM for the same input.

Exports:

  • <ActivityFeed> — flat vertical list of activity rows.
  • <ActivityFeedItem> — single row (avatar + actor/verb/target + timestamp + body).
  • <ActivityFeedGroup> — heading + list, compose multiple for "Today / Yesterday" feeds.
  • ActivityFeedItemData type for row data.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { ActivityFeed, ActivityFeedGroup } from '@molecule/app-activity-feed-solid'

const items = [
  { id: '1', actor: 'Alice', verb: 'commented on', target: 'PR #42', timestamp: '2m ago' },
  { id: '2', actor: 'Bob', verb: 'closed', target: 'Issue #7', timestamp: '1h ago' },
]

export function Activity() {
  return (
    <>
      <ActivityFeed items={items} emptyState={<p>No activity yet.</p>} />
      <ActivityFeedGroup heading="Today" items={items} />
    </>
  )
}

Type

feature

Installation

npm install @molecule/app-activity-feed-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

ActivityFeedItemData

Per-row activity data.

interface ActivityFeedItemData {
  /** Row id (the render key). */
  id: string
  /** Actor avatar source URL. */
  avatarSrc?: string
  /** Actor display name. */
  actor: JSX.Element
  /** Verb describing the action ("commented on", "assigned", "completed"). */
  verb: JSX.Element
  /** Object of the action ("the ticket", "Project Alpha", etc.). */
  target?: JSX.Element
  /** Optional supporting body (quote, diff, preview). */
  body?: JSX.Element
  /** ISO timestamp or any node to render as "time ago". */
  timestamp: JSX.Element
  /** Optional leading icon (replaces avatar when present). */
  icon?: JSX.Element
}

ActivityFeedProps

Props accepted by the ActivityFeed component.

interface ActivityFeedProps {
  /** Items in display order (usually most-recent first). */
  items: ActivityFeedItemData[]
  /** Rendered when `items` is empty. */
  emptyState?: JSX.Element
  /** Optional footer (e.g. "Load more"). */
  footer?: JSX.Element
  /** Extra classes. */
  className?: string
}

ActivityFeedItemProps

Props accepted by the ActivityFeedItem component.

interface ActivityFeedItemProps {
  /** The row to render. */
  item: ActivityFeedItemData
  /** Extra classes on the row wrapper. */
  className?: string
}

ActivityFeedGroupProps

Props accepted by the ActivityFeedGroup component.

interface ActivityFeedGroupProps {
  /** Group heading — typically a formatted date ("Today", "Yesterday", "Mar 12"). */
  heading: JSX.Element
  /** Items in this group. */
  items: ActivityFeedItemData[]
  /** Extra classes. */
  className?: string
}

Functions

ActivityFeed(props)

Simple activity feed — renders each item via <ActivityFeedItem> and stacks them. With no items and an empty state, React renders the empty state alone; for date-grouped feeds use <ActivityFeedGroup>.

React keys each row by the item's id value, so a re-passed or re-ordered array keeps the rendered rows per id. Solid's For keys by reference, so the rows are keyed through stable per-id records: the record for an id is created once and reused, while the row's content reads the CURRENT item for that id reactively.

function ActivityFeed(props: ActivityFeedProps): JSX.Element
  • props — Component props (see ActivityFeedProps).

Returns: The rendered activity feed.

ActivityFeedGroup(props)

Date-grouped activity section — a heading followed by a stack of items. Compose multiple groups together for an organized "Today / Yesterday / Last week" feed.

React keys each row by the item's id value, so the rows are keyed through stable per-id records here for the same DOM survival across a re-passed or re-ordered array.

function ActivityFeedGroup(props: ActivityFeedGroupProps): JSX.Element
  • props — Component props (see ActivityFeedGroupProps).

Returns: The rendered activity group.

ActivityFeedItem(props)

One entry in an activity feed.

Shape: [avatar|icon] [actor verb target · timestamp] [body]. The leading column renders the item's icon when supplied, otherwise an <Avatar> for avatarSrc, otherwise nothing — React's icon ?? (avatarSrc ? … : null).

function ActivityFeedItem(props: ActivityFeedItemProps): JSX.Element
  • props — Component props (see ActivityFeedItemProps).

Returns: The rendered activity row.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.5.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid

  • @molecule/app-ui

  • @molecule/app-ui-solid

  • solid-js

  • Requires a bonded ClassMap (getClassMap()); rendering throws otherwise.

  • Rows are keyed by their id, so a re-passed or re-ordered list keeps each row's DOM the way React's key does.