Staaarter

Switchable Capability Ledger

A capability section with a row of pill filters up top. Clicking a filter swaps the ruled list below it to only that group's entries, each rendered as a three-column row: a title, a short explanation, and the typical duration pinned to the right.

By Staaarter Team
Feature
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/switchable-capability-ledger.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/feature/feature23.tsx instead.

Usage

The file also exports feature23Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Feature23, feature23Demo } from "@/components/blocks/feature/feature23";

export default function Page() {
  return <Feature23 {...feature23Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstringundefinedSmall label above the heading.
headingReactNodenoneSection heading.
descriptionstringundefinedSupporting paragraph under the heading.
filtersFeature23Filter[]nonePill filter options; the first entry is active by default.
entriesFeature23Entry[]noneLedger rows, each tagged with the filter id it belongs to.
classNamestringnoneExtra classes for the outer section element.

Types

interface Feature23Filter {
  id: string;
  label: string;
}

interface Feature23Entry {
  filterId: string; // matches a Feature23Filter.id
  title: string;
  description: string;
  duration: string;
}

Behavior notes

  • Real interactivity: clicking a pill filter updates local state and the ledger list below re-filters to only the entries whose filterId matches, using the Button component's aria-pressed state to mark the active pill.
  • The first filter in the array is active by default; there is no URL or prop-driven initial filter.
  • If a filter has no matching entries, the ledger shows a plain empty-state message instead of an empty list.
  • Rows stack the title above the explanation on narrow screens and lay out as three columns from the sm breakpoint up.