ComponentsData display

Topic list

Forum and discussion topics: each TopicRow has the title (the whole row is a link), category and tags, reply and view counts, and who posted last and when — with pinned, solved, locked and unread states. TopicList adds column heads on wide containers and an empty state; sorting, filtering and paging stay in the app.

components/topic-list.tsxtheme · material · accent · density · font

Installation

$ pnpm add @vamos-ui/react

The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";

Usage

import { TopicList, TopicRow } from "@vamos-ui/react";

<TopicList aria-label="Latest topics" topics={topics} />

<ul>
  <li><TopicRow title="Quiet fans for a compact case" href="/t/88" replies={7} views={402} lastPost={{ name: "Jonas Ek", at: post.createdAt }} /></li>
</ul>

Relative times render as a date on the server and switch to "3 hr. ago" after hydration unless now is passed.

Category and tag links sit above the row link, so each stays its own tab stop.

Examples

Sorting and an empty state

The app sorts and filters; ToggleGroup drives it. empty replaces the list when nothing matches.

TopicRow on its own

In a narrow sidebar the row folds: counts at the end, last post underneath. tagHref turns tags into links.

API

TopicList

PropTypeDefault
topics
Rows: TopicRow props plus an id.
TopicListItem[]—
aria-label / aria-labelledby
Name of the list.
string—
showHeader
Column heads on wide containers.
booleantrue
empty
Shown when topics is empty.
ReactNode"No topics yet."
headingLevel
Level of every title.
2 | 3 | 4 | 53
now
Fixed epoch ms for relative times (static pages, tests).
number—

TopicRow

PropTypeDefault
title / href
The topic and its page; the link covers the row.
string—
excerpt
One line of the first post (wider containers).
string—
category
Board or category.
{ label; href? }—
tags / tagHref
Shown as #tag; links with tagHref.
string[] / (tag) => string—
replies / views
Counts, compact on screen (1.8K), spoken in full.
number—
lastPost
Avatar, name and relative time of the latest post.
{ name; src?; at }—
pinned / solved / locked / unread
States: pin and lock icons, Solved and New badges.
boolean—
labels
Dictionary namespace "topicList" (en, tr, de, fr, es, ar built in).
Partial<TopicListLabels>—