@molecule/app-leaderboard-list-solid

Feature · leaderboard-list · App (browser) · v1.1.3 · Apache-2.0

Wrapper list above leaderboard rows with podium / top-N highlighting

npm install @molecule/app-leaderboard-list-solid

npm · Source on GitHub

How it works

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

import { LeaderboardList } from '@molecule/app-leaderboard-list-solid'

const entries = [
  { id: 'u1', rank: 1, name: 'Alice Chen', score: 4820 },
  { id: 'u2', rank: 2, name: 'Bo Diaz', score: 4515 },
]

export function TopContributors() {
  return (
    <LeaderboardList title="Top Contributors">
      {entries.map((e) => (
        <div class="flex justify-between">
          <span>{`${e.rank}. ${e.name}`}</span>
          <strong>{e.score}</strong>
        </div>
      ))}
    </LeaderboardList>
  )
}

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

Reference

Solid leaderboard list container.

Exports LeaderboardList — header row (title + actions) above a vertical stack of rows. Props: children (pre-rendered rows), title?, actions? (period selector, filters), emptyState?, className?. Pair with a row component (@molecule/app-leaderboard-row-react in React apps; your own Solid rows otherwise) — this container adds no rank/podium logic of its own. It is the Solid counterpart of @molecule/app-leaderboard-list-react: same props and the same DOM for the same input.

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 { LeaderboardList } from '@molecule/app-leaderboard-list-solid'

const entries = [
  { id: 'u1', rank: 1, name: 'Alice Chen', score: 4820 },
  { id: 'u2', rank: 2, name: 'Bo Diaz', score: 4515 },
]

export function TopContributors() {
  return (
    <LeaderboardList title="Top Contributors">
      {entries.map((e) => (
        <div class="flex justify-between">
          <span>{`${e.rank}. ${e.name}`}</span>
          <strong>{e.score}</strong>
        </div>
      ))}
    </LeaderboardList>
  )
}

Type

feature

Installation

npm install @molecule/app-leaderboard-list-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

LeaderboardListProps

Props accepted by the LeaderboardList component — the same props @molecule/app-leaderboard-list-react accepts.

interface LeaderboardListProps {
  /** Pre-rendered leaderboard rows. Map your entries so the empty case is detectable. */
  children?: JSX.Element
  /** Optional title above the list. */
  title?: JSX.Element
  /** Optional period selector / actions row. */
  actions?: JSX.Element
  /** Optional empty state. Rendered only when there are no children. */
  emptyState?: JSX.Element
  /** Extra classes. */
  className?: string
}

Functions

LeaderboardList(props)

Container above a stack of rows — header + actions + the list. Doesn't itself render rank logic; pair with <LeaderboardRow> from @molecule/app-leaderboard-row-react (or your own rows).

The emptyState renders only when children is empty or absent; map your entries directly (as in the example) so the empty case is detectable.

function LeaderboardList(props: LeaderboardListProps): JSX.Element
  • props — Component props (see LeaderboardListProps).

Returns: The rendered leaderboard list.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.15.0 || ^4.0.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

  • emptyState renders only when children is empty or absent; if you pass a fragment or a single element the list always renders. Map your entries directly (as in the example) so the empty case is detectable.

  • No data-mol-id prop; styling resolves through getClassMap().