Skip to content
Back to skills

Resource

ASecurity

The forge-web-runtime <Resource> data-table container — the loading/error/empty/data ladder, debounced server-side filter and cursor pagination with useQueryResource and a generated list hook, its layout, sorting (sortKey / order_by) and row clicks.

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 13, 2026
developmentgofrontend

Works with

  • cursor
  • cli

Security analysis

A100/100

Scanned November 13, 2026

npx -y skills add reliant-labs/forge --skill resource --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Resource?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Resource
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reliant-labs-resource/badge)](https://www.skillsdirectory.com/skills/reliant-labs-resource)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: frontend-runtime/resource
description: The forge-web-runtime <Resource> data-table container — the loading/error/empty/data ladder, debounced server-side filter and cursor pagination with useQueryResource and a generated list hook, its layout, sorting (sortKey / order_by) and row clicks.
---

# `<Resource>` — the data-table container

`<Resource>` encapsulates the loading / error / empty / data tristate ladder,
a debounced server-side filter, and cursor pagination in one owned-once
component. Pair it with `useQueryResource` and a generated list hook. Do not
hand-roll the tristate ladder, and do not client-side-filter a single page cap.
Pass the query's error straight through: the error rung renders
`userMessage(error)`, so there is nothing to pre-format.

```tsx
import { Resource, type ResourceColumn } from "@reliantlabs/forge-web-runtime";
import { useQueryResource } from "@/hooks/use-query-resource";

const columns: ResourceColumn<Item>[] = [
  { header: "Name", cell: (i) => i.name },
  { header: "Created", cell: (i) => fmtDate(i.createdAt) },
];

export function ItemsPage() {
  const [cursor, setCursor] = useState<string[]>([]);
  const [filter, setFilter] = useState("");
  const q = useQueryResource(useListItems({ pageToken: cursor.at(-1), filter }));
  return (
    <Resource
      title="Items"
      status={q.status}
      data={q.status === "success" ? q.data.items : undefined}
      error={q.status === "error" ? q.error : undefined}
      columns={columns}
      rowKey={(i) => i.id}
      filter={filter}
      onFilterChange={setFilter}
      onNextPage={() => setCursor((c) => [...c, nextToken])}
      onPrevPage={() => setCursor((c) => c.slice(0, -1))}
      hasNextPage={Boolean(nextToken)}
      hasPrevPage={cursor.length > 0}
    />
  );
}
```

Layout: header (`title` + `actions`, the primary action only), a wrapping
toolbar (search + `toolbar`, where filters go), the table, and a footer with
the count (`totalCount`; `pageStart` for "1–25 of 112") and the pager.

- **Sorting**: a column's `sortKey` (the List `order_by`) plus `sort` /
  `onSortChange` make its header an `aria-sort` button (asc → desc → off).
  pkg/crud pages only in key order: a sorted List is one page.
- **Row clicks**: link the primary cell, pass `rowsHaveLinks` (rows stay
  table rows); without it an `onRowClick` row is a button.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.